LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Bug Reports > [Resolved] DirectoryMatch and Directory causes all 404s to become 403s

Reply
 
Thread Tools Display Modes
  #1  
Old 05-09-2010, 10:21 PM
aww aww is offline
Senior Member
 
Join Date: May 2007
Posts: 237
Default [Resolved] DirectoryMatch and Directory causes all 404s to become 403s

The use of DirectoryMatch or Directory, ie.

Code:
<DirectoryMatch "\.(svn|git)">
   Order allow,deny
   Deny from all
</DirectoryMatch>
or
Code:
<Directory ~ "\.(svn|git)">
   Order allow,deny
   Deny from all
</Directory>
Causes any 404 to instead become a 403

ie. http://www.litespeedtech.com/ignore4...1232365346.txt

should properly produce a 404

adding any directorymatch rule causes it to become 403, even if it's not affected by the rule

Last edited by NiteWave; 05-11-2010 at 06:08 PM..
Reply With Quote
  #2  
Old 05-10-2010, 07:43 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
How was <Directory ...> directives are added?
If you add those via Apache Style configuration in LSWS web console, it wont work properly, you should use LSWS native Context configuration instead.
Reply With Quote
  #3  
Old 05-11-2010, 12:26 AM
aww aww is offline
Senior Member
 
Join Date: May 2007
Posts: 237
added via .htaccess

If litespeed doesn't support it, perhaps it could just ignore them so it doesn't break 404 errors.

The rules need to be left there for apache backward compatibility.
Reply With Quote
  #4  
Old 05-11-2010, 02:26 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
Hi,

I did tests on Apache 2, if in .htaccess there is
Code:
<DirectoryMatch "\.(svn|git)">
   Order allow,deny
   Deny from all
</DirectoryMatch>
normal access to a file will return "500 Internal Server Error". without "<DirectoryMatch" directive, will be "200 OK".
and there is an entry in error_log:
Code:
[Tue May 11 04:42:33 2010] [alert] [client x.x.x.x] /usr/local/apache/htdocs/.htaccess: <DirectoryMatch not allowed here
in apache doc:
http://httpd.apache.org/docs/2.0/mod...html#directory
Code:
<Directory> Directive
Context:	server config, virtual host
<DirectoryMatch> Directive
Context:	server config, virtual host
I was confused with it too. Thanks for raising the issue to get it clear.

Last edited by NiteWave; 05-11-2010 at 07:56 AM..
Reply With Quote
  #5  
Old 05-11-2010, 06:02 AM
aww aww is offline
Senior Member
 
Join Date: May 2007
Posts: 237
Wow - that advice is given out all over the web and I guess everyone just repeats it without checking if it really can be used in .htaccess or not. Weird.
Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:01 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.