Announcement

Collapse
No announcement yet.

Custom Error page question

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom Error page question

    After a major update, I had my site set up so that when someone didn't find a page on my site, instead of the error code, they got my sitemap. This way they could find the new page.

    I did not set this up, hostgator did. But they don't seem to do it any longer.

    And a few months ago I noticed that the error page is instead THEIR page. (which takes someone off my site .. and loses them.

    In trying to get hostgator to better explain this page http://support.hostgator.com/article...om-error-pages I have not received the "right help".

    Can you help me set it up so that when someone goes to a page that no longer exists, they get my sitemap?

    Thank you.

  • #2
    Really hostgator can do what they like. Your alternative is to try a .htaccess 401 redirect. Which may not work if hostgator sets it. Or you can ask hostgator to change it.

    Comment


    • #3
      So I'm on the right track in thinking that I'll continue to call HostGator until I find the right person who can do it?!?

      Comment


      • #4
        Yeah but hosting companies are a pain to get anything done. Most of the time you'll just get a sale rep and not a programmer. I'd try creating the. htaccess file first though.

        Comment


        • #5
          'cus i'm a lovely lad!

          I've attached a .htaccess file for you.

          if you already have one then you just need to add this part to the bottom of your existing file.

          Code:
          #first part defines that is for an error
          #second part defines the error number
          #third part is the webpage that should be displayed.
          ErrorDocument 400 /400.html    
          ErrorDocument 401 /401.html
          ErrorDocument 403 /403.html
          ErrorDocument 404 /404.html
          ErrorDocument 500 /500.html
          ErrorDocument 502 /502.html
          ErrorDocument 504 /504.html
          and with php error pages

          Code:
          ErrorDocument 400 /error-code.php?error=400
          ErrorDocument 401 /error-code.php?error=401
          ErrorDocument 403 /error-code.php?error=403
          ErrorDocument 404 /error-code.php?error=404
          ErrorDocument 500 /error-code.php?error=500
          ErrorDocument 502 /error-code.php?error=502
          ErrorDocument 504 /error-code.php?error=504
          This should be located in your websites root directory.

          either
          Code:
          '\'
          or if you use public_html then place it inside there
          Code:
          '\public_html\.htaccess'
          Attached Files
          Who needs a Signature?

          Comment


          • #6
            On a side note you can also use .htaccess to redirect to a sub-directory. For instance if you were running multiple languages on the same server php,asp etc they can run from after specific sub-directories. For instance on my server I have a redirect to /htdocs which runs asp or /jsp which runs jsp

            Comment


            • #7
              Sbeynon

              Appreciate the code! Thank you (and you left your fellow countryman coothead in the wind)

              I do have a htaaccess text file.

              1) do I need to change www.elevatingyourbusiness.com/sitemap.html to (for example) 404.html or can I use the page I mentioned above.

              2) I have to go check what each of the error pages mean so that I have the correct pages going to the sitemap page.

              Comment


              • #8
                Hi maria,

                I'll quote a StackOverflow answer for this one.
                Originally posted by Zistoleon
                Sitemap.xml helps your website to be well and fast indexed. By submitting this file to search engines, I don't see any good reason to ask them to index a page that doesn't exist (404 HTTP status).
                link to source

                I'd imagine you don't need to put these pages in the sitemap
                Who needs a Signature?

                Comment

                Working...
                X