开发者

.htaccess subfolders redirect with making other subfolder available?

开发者 https://www.devze.com 2023-03-21 10:28 出处:网络
I have the following folders structure 开发者_JAVA技巧/folder1/main/ /folder1/administrator /folder2/

I have the following folders structure

开发者_JAVA技巧/folder1/main/
/folder1/administrator
/folder2/ 

I want to write a .htaccess file that redirects the clients from the root to /folder1/main/ but let /folder1/administrator and /folder2/ available if requested directly?

Any help please?


This is a common pattern. The general solution is to put in before the RewriteRule a couple of conditions "don't do this if the request filename is a directory" and ditto for file. The conditions are:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号