The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

rediect 404 to hompage

Discussion in 'General Discussion' started by creeper, Jun 30, 2004.

  1. creeper

    creeper Member

    Joined:
    May 28, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    can anyone help me accomplish this?

    Thank you
     
  2. creeper

    creeper Member

    Joined:
    May 28, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Pretty Please?
     
  3. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    Create an .htaccess file containing the following:

    ErrorDocument 404 /index.html

    (change index.html for whatever you use as your homepage), and copy it to your web root.
     
  4. creeper

    creeper Member

    Joined:
    May 28, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Great that worked... thank you!!

    How about if i want it to display a 404 page which then redirects to index?

    Also how come it leaves the bad url in and doesn't change the url?

    I appreciate your Help.. need hosting space? lol
     
  5. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    Then change the index.htm to whatever page you would like and use a refresh meta tag in that document to point people to the index.

    That is how it works. If you send people via a refresh redirect as described above, then the URL will change.

    No thanks I am all set on hosting space ;)
     
  6. creeper

    creeper Member

    Joined:
    May 28, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Again.. Thanks bro!!
     
  7. ServerCafe

    ServerCafe Member

    Joined:
    Jan 28, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    You would think...

    You would think that, since a page specifically named 404.shtml may not work for everyone, CPanel would have a clue that maybe adding the option to automatically insert the page name redirect of your choice in the .htaccess file would be a good idea.

    In my case, I had to insert
    ErrorDocument 404 /missing.php​
    since I already had a document created and .shtml simply wouldn't work.

    Thus, the "Error pages" link in CPanel is pretty worthless.
     
  8. broken-window

    broken-window Registered

    Joined:
    May 3, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Chicago, Illinois
    Error Pages

    Is there a way to use the "Error Pages" link within cPanel to do something similar to what you describe in this thread? I don't know how to do what you have suggested. I am new to cPanel and totally stupid to HTML. Thanks.
     
  9. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    No, but the method described is pretty straightforward.

    Simply FTP to your account, go to your public_html folder and edit the file named .htaccess.

    There may be a line in the file that reads:

    Code:
    ErrorDocument 404 /filename.ext
    If so, change it to read:

    Code:
    ErrorDocument 404 /mychosenfilename.ext
    If the line is not present, simply add it!
     
Loading...

Share This Page