2015-11-03 74 views
0

我WordPress的工作,我有以下URL这是工作的罚款:的.htaccess重写规则需要

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] 
+0

所以URL'/ project/forum/customer-forum /'在WordPress之外? – MrWhite

+0

论坛是WordPress的文件夹名称,我使用bbpress论坛和bbpress生成链接论坛/论坛/客户论坛/但我想要客户论坛 –

回答

0

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

要由WordPress被处理,然后在排除这个URL。 htaccess文件在/project/forum/customer-forum/.htaccess您可以简单地启用RewriteEngine。这将防止处理父(WordPress).htaccess文件中的mod_rewrite指令。

RewriteEngine On