Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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/9/loops/2.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 使用.htacess删除部分url,但在内部重定向到原始url_Wordpress_.htaccess_Mod Rewrite - Fatal编程技术网

Wordpress 使用.htacess删除部分url,但在内部重定向到原始url

Wordpress 使用.htacess删除部分url,但在内部重定向到原始url,wordpress,.htaccess,mod-rewrite,Wordpress,.htaccess,Mod Rewrite,我已经使用preg_replace修改了href链接 例如,原始链接是 http://testdomain/test/save20 到 http://testdomain/save20 但是当我点击这个链接的时候,我仍然会http://testdomain/test/save20 此外,我只想在浏览器中更改它,就像 http://testdomain/save20 但在内部,它应该继续使用url http://testdomain/test/save20 我已经试过了。像这样 重写规则^test

我已经使用preg_replace修改了href链接

例如,原始链接是 http://testdomain/test/save20

到 http://testdomain/save20

但是当我点击这个链接的时候,我仍然会http://testdomain/test/save20

此外,我只想在浏览器中更改它,就像

http://testdomain/save20 但在内部,它应该继续使用url

http://testdomain/test/save20

我已经试过了。像这样

重写规则^test/[^/]+/?$/test=$1[NC,L]

但它似乎没有任何效果

.htaccess中的完整代码如下所示:

开始WordPress
您可以使用以下规则

RewriteEngine on
RewriteRule ^([^/.]+)$ /test/$1 [L]
我还是觉得http://testdomain/test/save20 点击链接。我希望将url更改为http://testdomain/save20
RewriteEngine on
RewriteRule ^([^/.]+)$ /test/$1 [L]