Wordpress htaccess重写规则不工作
我想点击以下url:Wordpress htaccess重写规则不工作,wordpress,.htaccess,mod-rewrite,Wordpress,.htaccess,Mod Rewrite,我想点击以下url: 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 以下是我的访问权限: <IfModule mod_r
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
以下是我的访问权限:
<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>
任何帮助都将不胜感激,我已经为此奋斗太久了。提前谢谢 您需要使用QSA标志查询字符串append 编辑以添加- 上面的示例仅涵盖您作为示例给出的URL。看了你自己的重写规则后,我想我明白你的意思了
RewriteRule ^/(.*)/e-recording-in-(.*)$ /index.php?pagename=$1/state&state=$2 [QSA,NC,L]
戴夫,不幸的是这没用。我试过了,有无前卫斜杠。它指向mysite.com/e-recording-countries/e-recording-in-犹他州我想要的URL,但服务器返回404,表明它从未收到带有变量的URL。
RewriteRule ^/(.*)/e-recording-in-(.*)$ /index.php?pagename=$1/state&state=$2 [QSA,NC,L]