PDA

View Full Version : directoryindex problem in htaccess



suman07
09-10-2008, 08:10 AM
hello to all,
I have used following codes in my htaccess file:

DirectoryIndex folder/index.php

such that when www.mysite.com is entered,
the page www.mysite.com/folder/index.php is opened and
www.mysite.com/index.php is seen in my address bar

But what happens is, all the subfolder within the root use the same htaccess file and all the subfolders tend to search file '/folder/index.php' which I don't want.
Is there any way to use the above code for only the root?
Thanx in advance

BLiZZaRD
09-10-2008, 02:18 PM
You can put AllowOverride (http://httpd.apache.org/docs/1.3/mod/core.html#allowoverride) directives inside <Directory (http://httpd.apache.org/docs/1.3/mod/core.html#directory)> containers in httpd.conf, with the <Directory> containers specifying directories which can and/or cannot use .htaccess. Example:



# Default to allow all to use .htaccess
<Directory /*>
AllowOverride All
</Directory>
#
# Disable .htaccess in this path
<Directory /cannot/use/htaccess/*>
AllowOverride None
</Directory>
#
# But turn some features back on for this one dir in the above path
<Directory /cannot/use/htaccess/but-this-one-can/*>
AllowOverride FileInfo Options
</Directory>