How can i redirect a 404 Page not Found to the index of my site?

Discussion in 'Site & Server Administration' started by wiredhosting.com.ar, May 8, 2006.

Thread Status:
Not open for further replies.
  1. #1
    Hi!

    I just wanted to know, how can i do to redirect all the 404 errors (Page not found) to the index of my website.

    THanks!
     
    wiredhosting.com.ar, May 8, 2006 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,906
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #2
    Have a file at in the public_html or htdocs folder of your website called .htaccess with this in it:
    ErrorDocument 404 /index.php
    Code (markup):
    However you should have a specific 404 page to handle it so that people know they made a mistake - and to let Google verify your site and start giving you stats.
     
    sarahk, May 8, 2006 IP
    kk5st likes this.
  3. ideas_man

    ideas_man Active Member

    Messages:
    212
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    58
    #3
    If you have the ability to use htacess then adding the following line would redirect all 404 traffic to your homepage:

    
    ErrorDocument 404 /index.html
    
    Code (markup):
    Hope this helps :)
     
    ideas_man, May 8, 2006 IP
  4. ideas_man

    ideas_man Active Member

    Messages:
    212
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    58
    #4
    Just beat me to it SarahK !!!! :)
     
    ideas_man, May 8, 2006 IP
  5. paidhosting

    paidhosting Peon

    Messages:
    4,822
    Likes Received:
    483
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Well if u have a cpanel than there is option for custom error pages for each sort of error, and in there u can introduce a meta refresh code , but remember to put no follow tag for google bot else u might hijack ur own rank :)
     
    paidhosting, May 9, 2006 IP
  6. theblight

    theblight Peon

    Messages:
    246
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Or maybe you should try a customized one to which they can choose a destination on your site like a 404 with a sitemap :D
     
    theblight, May 10, 2006 IP
Thread Status:
Not open for further replies.