404 document not found
404 document not found
Hi I have quite a few 404 errors that I can see from my stats. Most of them are old links which have been changed when I upgraded the software. How do I find where the links are now, I must have put them on some sites but obviously when they get clicked now peeps get at 404 error!
A few steps, but they are sort of technical(ish):
1. Create a file 404.html and put this into your root directory on your website (i.e. the same place that you have the index.html file).
This 404.html will display whenever your website visitor gets a 404 error, so make it pretty and friendly; something like "Sorry you have come to the wrong place, click here to see our website"
2. Then, depending on your webstats you should be able to see the referring page whenever this 404.html is displayed.
3. If you want to get really clever, you can write some code (in PHP or ASP or similar) which actually gets the referring page and writes to a log or something. This is what your webstats should already be doing, so its an alternative.
1. Create a file 404.html and put this into your root directory on your website (i.e. the same place that you have the index.html file).
This 404.html will display whenever your website visitor gets a 404 error, so make it pretty and friendly; something like "Sorry you have come to the wrong place, click here to see our website"
2. Then, depending on your webstats you should be able to see the referring page whenever this 404.html is displayed.
3. If you want to get really clever, you can write some code (in PHP or ASP or similar) which actually gets the referring page and writes to a log or something. This is what your webstats should already be doing, so its an alternative.
** Richard
PIMS: Holiday Rental Management system
They say we learn from our mistakes. That makes me a genius !
PIMS: Holiday Rental Management system
They say we learn from our mistakes. That makes me a genius !
-
- Posts: 9
- Joined: Tue Aug 16, 2011 9:14 pm
- Location: Windermere
roxytoo, is your website hosted on a windows server or unix?
If unix then its fairly simple, you need to create a .htaccess file within your www root directory, this redirects any errors to a custom error page. It needs to contain the following code:
/error.php is what I use, however it could be a .html file.
I design my sites to log all errors in a text file, including the referring website/page and referring client browser type to a text file.
With this info, I can then hook up a redirect to bounce any hits to the old page directly to the new page.
If you need any help setting this up on your web site give me a shout.
If unix then its fairly simple, you need to create a .htaccess file within your www root directory, this redirects any errors to a custom error page. It needs to contain the following code:
Code: Select all
# Error Pages
ErrorDocument 400 /error.php
ErrorDocument 401 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php
ErrorDocument 500 /error.php
I design my sites to log all errors in a text file, including the referring website/page and referring client browser type to a text file.
With this info, I can then hook up a redirect to bounce any hits to the old page directly to the new page.
If you need any help setting this up on your web site give me a shout.
-
- Posts: 9
- Joined: Tue Aug 16, 2011 9:14 pm
- Location: Windermere
Yes if you already have a .htaccess file (which I presume is empty at the moment?) add the above code changing error.php for the error page you want to redirect your visitors too.roxytoo wrote:Thanks for the replies
Do be honest I don't know what my website is hosted on! I do have an hta access file, shall I just add the code to that?