.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
精彩评论