Custom error pages
Moderator: General Moderators
Custom error pages
Is it possible to redirect a user to a custom error page using PHP only in case some server error happens (such as 404)? Or is it only possible by configuring Apache itself? I'm asking this since I would like to have this functionality on shared hosts which do not allow server configuration.
You may be able to add a .htaccess file in your webroot. I'm not 100% sure if this will work at the htaccess level, but this is standard vhost configuration option on Apache. Of course.. this is assuming that your site is running on Apache webserver...
Hope this helps
hanji
Code: Select all
ErrorDocument 404 http://www.yoursite.com/error.htm
ErrorDocument 403 http://www.yoursite.com/error.htmhanji