我想点击以下网址:
mysite.com/e-recording-counties/e-recording-in-utah
让服务器收到:
mysite.com/e-recording-counties/state?state=utah
但它似乎正在获得:
mysite.com/e-recording-counties/state
,浏览器位置显示:
mysite.com/e-recording-counties/state
这是我的htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)/e-recording-in-(.*)$ ?pagename=$1/state&state=$2 [NC,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
任何帮助都会非常感激,我一直在努力解决这个问题太久了。提前谢谢!
答案 0 :(得分:0)
您需要使用QSA标志(查询字符串追加)
https://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
RewriteRule ^/e-recording-counties/e-recording-in-([a-z]+)$ /e-recording-counties/state?state=$1 [L,QSA,NC]
编辑添加 - 上面的示例仅涵盖您提供的URL作为示例。在查看自己的重写规则后,我想我会看到你所追求的目标。
RewriteRule ^/(.*)/e-recording-in-(.*)$ /index.php?pagename=$1/state&state=$2 [QSA,NC,L]