URL重写在.htaccess中无法正常工作

时间:2017-02-17 18:37:14

标签: .htaccess

我正在尝试在我的.htaccess文件中为我的wordpress网站创建一个重写。我需要 www.a3performance.com/fastestsuit 指向 http://www.a3performance.com/legend-fastest-racing-suit/

我正在尝试这个,但它似乎不起作用?

RewriteRule ^fastestsuit/?$ legend-fastest-racing-suit [NC,L]

2 个答案:

答案 0 :(得分:1)

似乎您需要在此处使用从一个文件夹重定向到新文件夹。 像这样:

RewriteRule ^subdirectory/(.*)$ /anotherdirectory/$1 [R=301,NC,L]

答案 1 :(得分:0)

实际上@labris的想法奏效了。出于某种原因,我的服务器需要一点注册.htaccess更改。

RewriteRule ^subdirectory/(.*)$ /anotherdirectory/$1 [R=301,NC,L]
相关问题