Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Page 1 of 2 12 LastLast
Results 1 to 15 of 28

This is a discussion on Custom Error Pages in the Open Discussion & Chit-chat forum
I have tried this before without results. I want to all 404 errors automatically send the viewer to the index page. How can I do ...

  1. #1
    Senior Member Michael's Avatar
    Join Date
    Jan 2002
    Location
    PA
    Posts
    225

    Custom Error Pages

    I have tried this before without results.

    I want to all 404 errors automatically send the viewer to the index page.

    How can I do this? I had gone through it once but it never worked.

    Thanks,
    Michael

  2. #2
    JPC Addict mike's Avatar
    Join Date
    Sep 2001
    Location
    Denver, Colorado
    Posts
    122
    I'm sure there's a better way to do it, but adding this to your 404 page should work too.

    <?
    header ("Location: index.php");
    exit;
    ?>

  3. #3
    Senior Member Michael's Avatar
    Join Date
    Jan 2002
    Location
    PA
    Posts
    225
    Tried that and it isn't working.

    Where are my error pages kept and what permission should they have?
    Thanks

  4. #4
    JohnH
    Guest
    You can also just put the following meta tag that will refresh to a page of your choice after X seconds...

    PHP Code:
    <META HTTP-EQUIV=Refresh CONTENT="10; URL=http://www.jaguarpc.com/"
    as shown above, 10 is the number of seconds that the browser waits before refreshing to the jaguarpc.com site

  5. #5
    Senior Member Michael's Avatar
    Join Date
    Jan 2002
    Location
    PA
    Posts
    225
    This is for an error page.

  6. #6
    JohnH
    Guest
    Originally posted by Michael
    Tried that and it isn't working.

    Where are my error pages kept and what permission should they have?
    Thanks
    Log into your control panel... click on 'Error Pages' and edit the custom error pages to your heart's content.

    Make sure that your error pages are bigger then 512bytes or Internet Explorer will use its default 404 error page.

  7. #7
    JohnH
    Guest
    Originally posted by Michael
    This is for an error page.
    You can choose to use PHP as mike mentioned above, but you need to change the extension of the 404 page to *.php.

    The simpler way would be to use meta tags to refresh the visitor to your index page after 0 seconds.

  8. #8
    Senior Member Michael's Avatar
    Join Date
    Jan 2002
    Location
    PA
    Posts
    225
    But it is not working.
    I have even called my 404.shtml page directly and it did not redirect.

    this is what I had,
    <!--#echo var="HTTP_HOST" -->
    <!--#echo var="HTTP_USER_AGENT" -->
    <?
    header ("Location: index.html");
    exit;
    ?>

    This I placed in 404.shtml in my public_html directory

  9. #9
    JohnH
    Guest
    ok - instead of using PHP, I think it would be best if you used meta tags as I mentioned before.

    Follow these steps closely:

    1) Log into your Control panel
    2) Click on error pages
    3) Click on 404 ' wrong page'
    4) copy and paste the following code into the text box for the 404:
    PHP Code:
    <META HTTP-EQUIV=Refresh CONTENT="0; URL=http://www.yoursite.com/"
    5) Change www.yoursite.com to your own domain
    6) Important Make sure that your 404.shtml file is at least 512 bytes in size - this is because Internet Explorer defaults to its own 404 page if a custom 404 page is not found on the site.

    You should just add in a paragraph of random text so that you can fill the 512 bytes.

    I just tested these steps and was able to make the 404 work.

  10. #10
    Senior Member Michael's Avatar
    Join Date
    Jan 2002
    Location
    PA
    Posts
    225
    I know I sound dumb I just could never get this to work.
    I am trying it

  11. #11
    JohnH
    Guest
    Let me know if you're still having trouble with it, I'll be glad you make you a sample 404.shtml file so that you can see the steps I've listed above finished.

    Don't worry about 'sounding dumb' - questions are questions and I am here to help with anything that I have had experience with

    g'luck

  12. #12
    Senior Member Michael's Avatar
    Join Date
    Jan 2002
    Location
    PA
    Posts
    225
    Ok, its working.
    I didn't know about that 512bytes thing.

    Thanks all for the help it really is nice since the domain used to be owned by others and there are a lot of links going to non existing pages now.

    I am wonder something though,
    If a SE runs through the links from other sites, won't the redirection from a meta tag cause trouble? Would redirecting through .htaccess or something be better?

    Thanks all,
    Michael

  13. #13
    JohnH
    Guest
    In your case, since the redirecting through meta tags are only used for error pages, I don't think it should be too much of a concern.

    Also, if you're worried thats going to effect your site in search engines, then you can try using .htaccess to directly point error pages to your index page. Not too sure about this though...

  14. #14
    Senior Member Michael's Avatar
    Join Date
    Jan 2002
    Location
    PA
    Posts
    225
    I got the .htaccess to work also.
    Is there a danger in using my full path http://www.tcog.org/index.html
    in my .htaccess? I am wondering because I read someone that
    you shouldn't.

    Michael

  15. #15
    JohnH
    Guest
    I personally don't think there is any danger.

    But problem would be if you wanted to change the domain name of the site or use the same .htaccess file within your sites.

    If you used relative paths, this wouldn't be a problem.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •