Lay My Hat home page Lay My Hat Forum
The forum for holiday rental owners


 
  FAQFAQ    SearchSearch    MemberlistMemberlist   UsergroupsUsergroups    RegisterRegister  
  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Log inLog in 

404 document not found

 
Post new topic   Reply to topic    Lay My Hat Forum Index -> The Workshop
View previous topic :: View next topic  
Author Message
roxytoo



Joined: 03 Feb 2005
Posts: 944
Location: Spain Costa Blanca

PostPosted: Mon Aug 29, 2011 9:21 am    Post subject: 404 document not found Reply with quote

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
View user's profile Send private message
e-richard



Joined: 17 Oct 2004
Posts: 3163
Location: Algarve, Portugal

PostPosted: Mon Aug 29, 2011 2:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
BarryLakes



Joined: 16 Aug 2011
Posts: 16
Location: Windermere

PostPosted: Mon Aug 29, 2011 3:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
roxytoo



Joined: 03 Feb 2005
Posts: 944
Location: Spain Costa Blanca

PostPosted: Sat Sep 03, 2011 7:24 am    Post subject: Reply with quote

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
View user's profile Send private message
casasantoestevo



Joined: 06 Nov 2006
Posts: 2103
Location: O Saviñao, Galicia

PostPosted: Sat Sep 03, 2011 7:39 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
BarryLakes



Joined: 16 Aug 2011
Posts: 16
Location: Windermere

PostPosted: Sat Sep 03, 2011 7:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
roxytoo



Joined: 03 Feb 2005
Posts: 944
Location: Spain Costa Blanca

PostPosted: Sun Sep 04, 2011 6:46 pm    Post subject: Reply with quote

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Lay My Hat Forum Index -> The Workshop All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group