Reputation:
I am trying to make 500, 404, etc. errors redirect. If you go to http://www.yoursite.com/934834984 it should redirect to http://www.yoursite.com/404. How do I make it do that? I tried using this code:
<meta http-equiv="refresh" content="0; url=http://yoursite.com/404" />
Keep in mind that I changed the domain to yoursite.com just for this question.
Upvotes: 1
Views: 6349
Reputation: 37
ErrorDocument 500 /errors/server.html not work for me
show in browser HTTP ERROR 500
Upvotes: 0
Reputation: 1238
You need to edit the .htacess file (with notepad) in your domain's root folder. Here are some common ones that you would add or change in the file. Obviously change the directory and locations (the part in italics). And don't include the numbers. Or you can change them from your cpanel without having to mess with the .htacess file
Upvotes: 0
Reputation: 24478
In Apache you can use ErrorDocument
. So in your .htaccess
file in the root of your domain you can add this to the end of the file.
ErrorDocument 404 /404.html
The files have to exist. Here is some more info as well.
http://support.hostgator.com/articles/custom-error-pages
Upvotes: 1