|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Hi,
I am trying to change the defalt index file for a particular directory by using DirectoryIndex in htaccess. I con't seem to get it to work. My htaccess file looks like this: <FilesMatch ".inc.php$"> require valid-user AuthUserFile /dir/.htpasswd AuthName ISE-Forums AuthType Basic </FilesMatch> DirectoryIndex wwwthreads.php But I get an error that looks like this: [Tue Feb 13 08:47:31 2001] [alert] [client 64.230.176.170] /dir/.htaccess: DirectoryIndex not allowed here It seems kosher how I implemented DirectoryIndex, but something obviously is not. Any ideas? Thanks. |
|
#2
|
|||
|
|||
|
First, AuthUserFile /dir/.htpasswd, the /dir must be full server path, not relative URL path.
Second, <FilesMatch ".inc.php$">, you need to escape the dot. Third, placing .htpasswd in the same dir of your protected files is absolutely fine, but you need to make sure it's not directly accessible from browser. If you try to access http://www.yourdomain.com/dir/.htpasswd after authenticated and get [403] error, then you're fine. |
|
#3
|
||||
|
||||
|
Thanks for the reply.
Quote:
It actually is. I removed the full path in the example I posted to forum for security reasons. Quote:
This is working fine as I have it set up now. The problem I am having is with the DirectoryIndex wwwthreads.phpwhich returns an error. Perhaps the problem is related to how I have the FilesMatch section set up. How would I escape the dots? Any other ideas on why DirectoryIndex wwwthreads.php is not working? Thanks! Michael |
|
#4
|
|||
|
|||
|
>> Any other ideas on why DirectoryIndex wwwthreads.php is not working?
Because you have told Apache not to allow Indexes to be overridden by .htacess. Check your httpd.conf for the <Directory> block of /path/to/dir and add Indexes to the AllowOverride line. Check here for more info -> http://httpd.apache.org/docs/mod/co...l#allowoverride >> How would I escape the dots? \ before the dot. |
|
#5
|
|||
|
|||
|
Thanks! That was the problem!
Michael |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > DirectoryIndex |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|