I dont know why i cant customize error 500 but its good for 404, 403
I have folder like that
- www
- index.php
- .htaccess (2)
- error
- index.php
- .htaccess (1)
the first htaccess
RewriteEngine on
RewriteBase /
# Error
ErrorDocument 403 /error/index.php?error=403
ErrorDocument 404 /error/index.php?error=404
ErrorDocument 500 /error/index.php?error=500
And second
RewriteEngine on
RewriteBase /
RewriteRule ^(.+)/$ /www/index.php?v=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /www/index.php?v=$1 [QSA,L]
Thanks
Customized Error 500 pages are the hardest to use. The problem is, there are many reasons why a server can throw a
500 internal server error
. Custom pages for 500 only work if the cause of the 500 can be handled by Apache to display the page. Say for instance you made a syntax error in your .htaccess page or in your apache config file, it's going to throw a500 server error
but because Apache isdown
, it can't serve anything including that custom page, so you get the browsers default page. Also depending on how you have your PHP error reporting setting you won't get 500 custom page either. There is a lot more to this and customizing 500 page is almost useless cause most people won't ever see that. You will know before they will because it's a 500 is typicallyconfiguration
issue, like a syntax error in your code.503
is the most common page a user will see especially if your site is down for maintenance and those are the one's I would focus on.Anyway, I'd take a look at this link to see more info on 500 custom pages on when and why it won't work.
Apache's ErrorDocument directive does not redirect.
Also from Apache docs
http://httpd.apache.org/docs/2.4/mod/core.html#errordocument