.htaccess需要RewriteRule

时间:2015-11-03 14:16:32

标签: wordpress .htaccess mod-rewrite

我正在使用WordPress,我有以下网址正常工作:

http://example.com/afm/forum/forums/forum/customer-forum/

但我想如果用户输入以下网址,则他们不应该被第一个重定向:

http://example.com/project/forum/customer-forum/

此外,所有内页应该适用于http://example.com/project/forum/customer-forum/

我在htaccess中尝试了以下操作,但它无法正常工作:

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

1 个答案:

答案 0 :(得分:0)

  

但我想如果用户输入以下网址,则不应该被第一个重定向:   http://example.com/project/forum/customer-forum/

要排除此网址被WordPress处理,请在/project/forum/customer-forum/.htaccess的.htaccess文件中启用RewriteEngine。这将阻止处理父(WordPress).htaccess文件中的mod_rewrite指令。

RewriteEngine On