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

发布于 2024-10-07 13:04:29 字数 294 浏览 0 评论 0原文

谁能告诉我将特定文件夹重定向到另一个文件夹的最佳方法是什么?

例如:

folderName1 -> subFolderName1
            -> subFolderName2 
            -> subFolderName3
folderName2

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

多谢!

can anyone tell me what's the best way to redirect a specific folder to another one?

for example:

folderName1 -> subFolderName1
            -> subFolderName2 
            -> subFolderName3
folderName2

and when i get "folderName1" (but not the specific "subFolderName1/2/3") i'm redirect automatically into "folderName2".

thanks a lot!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

野味少女 2024-10-14 13:04:29

如果我上面的评论是正确的那么:

RewriteEngine on

RewriteRule ^folderName1/ /folderName2/ [R,NC]

If my comment above is true then:

RewriteEngine on

RewriteRule ^folderName1/ /folderName2/ [R,NC]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文