【发布时间】:2020-07-23 07:39:35
【问题描述】:
我对如何使用 .htaccess 重写网址感到奇怪。 有人可以解释一下下面的重写吗?
原文: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.
【问题讨论】:
-
您是否已经进行了重写?
-
请勿在评论区发布代码。编辑您的问题以包含它。
标签: php apache .htaccess url-rewriting