.htaccess 重写url参数和key

AttDefCon

我对如何使用 .htaccess 重写 url 感到奇怪。任何人都可以对以下重写有所了解吗?

原文:index.php?param1=value1想要:index.php/param1/value1

和原始:index.php?param2=value2需要:index.php/param2/value2

param1 和 param2 是固定的,但它们的值不同。

在 index.php 上,我想用 $_[GET] 检索参数

我正在尝试这样的事情

RewriteCond %{QUERY_STRING} conf=(.+)

RewriteRule ^ /%1/? [R,L](.+)

对于 param1 = conf。

菲利普·罗林斯

重写规则看起来像

RewriteRule ^index.php/([^\/]+)/([^\/]+) /index.php?$1=$2 [L]

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章