![]() |
nested ErrorDocuments not working
I just realized that nested ErrorDocuments are not working in my older 3.1.1 copy (I will have to wait until a lighter load overnight to upgrade to the 3.1.1 final release but this might be wrong in both)
ie. /public_html/missing-example.html can have one errordocument in htaccess /public_html/images/missing-image.jpg could be a lower level .htaccess in images overriding the one above it Works perfectly in apache. Not in LiteSpeed. LiteSpeed shows the top ErrorDocument. Actually, possibly the LAST errordocument for that error code it processed. ie. /.htaccess /images/.htaccess /blog/.htaccess The errordocument for 404 in /blog/ will be shown if a 404 occurs in /images/ or / At least in my working server. You might want to test this on 3.1.1 production, otherwise I will also test it on the latest tonight. |
It works fine in lab environment, maybe it is caused by something else.
|
Well I am experiencing ErrorDocument issues.
1. Upgraded to 3.1.1 final release 2. Created a brand new fresh account under cpanel called "demosite" 3. made a test document index.html 4. http://ipaddress/~demosite/index.html works as expected 5. http://ipaddress/~demosite/blahblahblah gives proper litespeed generic 404 page 6. create and upload .htaccess with single line: ErrorDocument 404 "missing 7. http://ipaddress/~demosite/blahblahblah server thinks about it for a few seconds and then times out with a blank page - view source shows it's blank note this step on apache with same httpd.conf & .htaccess produces proper "missing" message |
I've traced the additional nested htaccess errordocument issues to litespeed being overly aggressive on rewrite issues in the topmost .htaccess
however the issue is so complex that I am having difficultly producing a simple example - will have to work on it - note that the issues do not exist when apache is running, it interprets the nested rules perfectly |
Quote:
|
Quote:
|
Okay here's the problem in how apache processes a certain rule differently than litespeed - it might be difficult for you to setup a test environment, though maybe you can do a quick wordpress install
/~demosite has a blog installed in /~demosite/blog/ To keep all the htaccess rules in the top-most directory, this is perfectly acceptable in apache <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /blog RewriteCond %{REQUEST_FILENAME} ^/home/demosite/public_html/blog/.*$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] </IfModule> However litespeed does not like this. For litespeed, these rules MUST be in .htaccess in /blog/ not / I have no idea why. But again, works in apache, not in litespeed This is what was messing up all the 404 error documents (except for the 404 "missing" which still does not work) Last but not least there is also a very minor issue in how litespeed treats: /~demosite/images/ as a 404 missing error, when it should be a 403 forbidden error because of -Indexes in a top-most .htaccess (or httpd.conf) This is trivial however compared to the other issue. |
Per your debug log request for the blank 404 "missing"
Code:
2007-05-16 03:43:18.772 [DEBUG] [123.123.123.123:63893-0#APVH_server.example.net] New request: |
LiteSpeed supports the QSA option on rewrites, correct?
|
Quote:
|
| All times are GMT -7. The time now is 01:06 AM. |