Need help for redirection

Discussion in 'Programming' started by mickael4973, Oct 15, 2008.

  1. #1
    hello, i just bought a new domain, which had traffic.
    i only bought the domain, and spiders dont find my pages.

    i need help to redirect all the 404 errors to my homepage.
    i tried to configure my 404.shtml page... but it doesnt work...
    i nnow that the best is httaccess, but i dont know how to configure it...
    can you help please?
     
    mickael4973, Oct 15, 2008 IP
  2. PixozuProductions

    PixozuProductions Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you have access to the .htaccess file, you can add the following line.

    ErrorDocument 404 /index.html

    Where I put index.html, you can put whatever file name, and thats where your 404 errors get redirected to. Hope this helps.
     
    PixozuProductions, Oct 15, 2008 IP
  3. 2-4-K

    2-4-K Peon

    Messages:
    834
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #3
    who are you hosting with? Some C Panel hosts allow you to modify the 404, 440, 500 basically all error pages with a static page or either a redirect to your index.. maybe check under your control panel.
     
    2-4-K, Oct 15, 2008 IP
  4. mickael4973

    mickael4973 Active Member

    Messages:
    531
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #4
    thank you, should i put this part in the httaccess file?

    will it work on old subdirectories?? or should i use a global path?
     
    mickael4973, Oct 15, 2008 IP
  5. mickael4973

    mickael4973 Active Member

    Messages:
    531
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #5
    thank you for the reply... i saw in my cpanel, but i have no idea what code should i put there
     
    mickael4973, Oct 15, 2008 IP
  6. hnaghy

    hnaghy Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    redirect is an HTTP function, not a DNS function. It can only be done by a web server.
     
    hnaghy, Oct 16, 2008 IP
  7. PixozuProductions

    PixozuProductions Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yes, it goes in the htaccess file, just add that text I posted to a new line in the htaccess file, and it will work in your subdirectories too.
     
    PixozuProductions, Oct 17, 2008 IP