Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old February 13th, 2001, 11:12 AM
Michael Caplan Michael Caplan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 14 Michael Caplan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

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.


Reply With Quote
  #2  
Old February 13th, 2001, 01:56 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #3  
Old February 13th, 2001, 02:59 PM
Michael Caplan Michael Caplan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 14 Michael Caplan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the reply.



Quote:
Originally posted by freebsd
First, AuthUserFile /dir/.htpasswd, the /dir must be full server path, not relative URL path.


It actually is. I removed the full path in the example I posted to forum for security reasons.

Quote:
Second, <FilesMatch ".inc.php$">, you need to escape the dot.


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

Reply With Quote
  #4  
Old February 13th, 2001, 04:21 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> 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.

Reply With Quote
  #5  
Old February 13th, 2001, 09:01 PM
Michael Caplan Michael Caplan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 14 Michael Caplan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up

Thanks! That was the problem!

Michael

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > DirectoryIndex


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway