Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress htaccess重写规则不工作_Wordpress_.htaccess_Mod Rewrite - Fatal编程技术网

Wordpress htaccess重写规则不工作

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

我想点击以下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_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]