htaccess从文件夹重定向到另一个文件夹,但不从其子文件夹重定向

时间:2010-12-14 16:04:25

标签: .htaccess redirect

任何人都可以告诉我将特定文件夹重定向到另一个文件夹的最佳方法是什么?

例如:

folderName1 -> subFolderName1
            -> subFolderName2 
            -> subFolderName3
folderName2

当我得到“folderName1”(但特定的“subFolderName1 / 2/3”)时,我会自动重定向到“folderName2”。

非常感谢!

1 个答案:

答案 0 :(得分:0)

如果我的上述评论为真,那么:

RewriteEngine on

RewriteRule ^folderName1/ /folderName2/ [R,NC]
相关问题