Package: apache2-mpm-prefork
Severity: normal
Version: 2.0.49-1
Hello,
Bug:
----
Apache2 doesn't handle ErrorDocuments set from a .htaccess file properly.
How:
----
Have a vhost configured and AllowOverrides All for your DocumentRoot.
Next put a .htaccess in your DocumentRoot which has:
ErrorDocument 404 /error/404.html
Ensure that the relative path to your 404.html really exists :)
Try to reach a nonexistant page.
What:
-----
You'll get a default 404 page telling you Not Found, and that there was
an additional error with the ErrorDocument.
Logs show:
----------
[snip] File does not exist: /var/vhosts/www.freshdot.net/html/aegaeg
[snip] File does not exist: /usr/share/apache2/error/404.html
Okay! So now try:
-----------------
Change the /error/404.html in your .htaccess to:
ErrorDocument 404 /var/vhosts/www.freshdot.net/html/error/404.html
Ensure that your path really exists :)
Try to reach a nonexistant page.
What:
-----
You'll get a default 404 page telling you Not Found, and that there was
an additional error with the ErrorDocument.
Logs show:
----------
[snip] File does not exist: /var/vhosts/www.freshdot.net/html/aegaeg
[snip] File does not exist: /var/vhosts/www.freshdot.net/html/var
Funny thing:
------------
When you specify:
ErrorDocument 404 /404.html
(make sure 404.html exists in DocumentRoot :P)
And request a nonexistant page, it nicely displays 404.html.
Conclusion:
-----------
ErrorDocuments set from .htaccess can only reside in DocumentRoot, in
contradiction to ErrorDocuments set from <VirtualHost> config.
Side-note:
----------
When you put in
ErrorDocument 404 error/404.html
And request a nonexistant page, all you see is 'error/404.html' in
plaintext. IMHO this should only happen when "wrapped in quotes", the
above should be handled as a relative path. But I could be wrong ;)
Then there's still this /htdocs problem that I need to reproduce before
I can bitch & moan about it ;))
Keep up the good work!
Kind regards,
Sander.
--
| You will experience a strong urge to do good; but it will pass.
| 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8 9BDB D463 7E41 08CE C94D
Attachment:
signature.asc
Description: Digital signature