| View previous topic :: View next topic |
| Author |
Message |
roxytoo

Joined: 03 Feb 2005 Posts: 944 Location: Spain Costa Blanca
|
Posted: Mon Aug 29, 2011 9:21 am Post subject: 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! |
|
| Back to top |
|
 |
e-richard
Joined: 17 Oct 2004 Posts: 3163 Location: Algarve, Portugal
|
Posted: Mon Aug 29, 2011 2:20 pm Post subject: |
|
|
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. _________________ ** Richard
Is your glass half full or half empty ?
I don't care - either way there is room for another half glass of wine.
PIMS: Holiday Rental Management made easy |
|
| Back to top |
|
 |
BarryLakes
Joined: 16 Aug 2011 Posts: 16 Location: Windermere
|
Posted: Mon Aug 29, 2011 3:30 pm Post subject: |
|
|
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:
| Code: |
# Error Pages
ErrorDocument 400 /error.php
ErrorDocument 401 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php
ErrorDocument 500 /error.php
|
/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. _________________ http://www.hollytree-lodge.co.uk
Super Deluxe Holiday Lodge - Limefitt Park - Lake District |
|
| Back to top |
|
 |
roxytoo

Joined: 03 Feb 2005 Posts: 944 Location: Spain Costa Blanca
|
Posted: Sat Sep 03, 2011 7:24 am Post subject: |
|
|
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? |
|
| Back to top |
|
 |
casasantoestevo

Joined: 06 Nov 2006 Posts: 2103 Location: O Saviñao, Galicia
|
Posted: Sat Sep 03, 2011 7:39 am Post subject: |
|
|
| 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? |
Well If you put a link to your website, say in your signature, we could help. _________________ Ian and Irene
Http://www.ribeirasacra.com |
|
| Back to top |
|
 |
BarryLakes
Joined: 16 Aug 2011 Posts: 16 Location: Windermere
|
Posted: Sat Sep 03, 2011 7:35 pm Post subject: |
|
|
| 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? |
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. _________________ http://www.hollytree-lodge.co.uk
Super Deluxe Holiday Lodge - Limefitt Park - Lake District |
|
| Back to top |
|
 |
roxytoo

Joined: 03 Feb 2005 Posts: 944 Location: Spain Costa Blanca
|
Posted: Sun Sep 04, 2011 6:46 pm Post subject: |
|
|
| Thanks |
|
| Back to top |
|
 |
|