How can I make a 404 not found page redirect to the index?

Discussion in 'Site & Server Administration' started by easydolla, Nov 21, 2008.

  1. #1
    I recently bought a site that has over 1k pages indexed in google, well I am adding a new script to it so all the pages that are indexed in google will not be a valid URL, so my question is what would I put in the .htaccess to make all those not found pages redirect to the home page?


    Help would GREATLY be appreciated as this is kinda big thing!

    Thanks!!!!!!!!!!!!
     
    easydolla, Nov 21, 2008 IP
  2. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #2
    ErrorDocument 404 /

    perhaps this would work.
     
    agnivo007, Nov 21, 2008 IP
  3. easydolla

    easydolla Peon

    Messages:
    403
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, how would I put that though,

    like

    ErrorDocument 404 / /index.php
    Code (markup):
    ^ Anything like that or is the second slash not nessecary?
     
    easydolla, Nov 21, 2008 IP
  4. amiman

    amiman Well-Known Member

    Messages:
    525
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    108
    #4
    no just the following

    index.php not required
     
    amiman, Nov 21, 2008 IP