开发者

.htaccess subfolders redirect with making other subfolder available?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜