这是我目前的.htaccess文件的内容:WordPress的重写规则不工作
# BEGIN WordPress
<IfModule mod_rewrite.c>
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
我想改变:
http://example.com/search/?location=&radius_key=sydney/&keyword=&geolocation=
到:
http://example.com/massage/sydney/
我已经修改脚本下面,但它并没有改变我的网址。你能指导我吗?任何形式的解决这个问题的反应是高度赞赏。由于
# BEGIN WordPress
<IfModule mod_rewrite.c>
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/massage/(.*)$ /search/? location=&radius_key=$1&keyword=&geolocation=
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
我使用了你的代码,并确实命中(http://example.com/search/?location=&radius_key=sydney&keyword=&geolocation=)。 页面显示“内部服务器错误”。 –
我编辑了代码,现在它应该更好。请记住,我刚刚重新安排了您提供的代码,并且应该对其进行调整。 – SimoneLazzaris
它不应该是这样吗? RewriteRule ^/massage /(.*)$ /search/\?.*location=([a-z0-9_.-]+)&.* geolocation = $ 1 [R = 301,L] –