SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    404 Page Implementation

    Hi there,

    For a while now I've had the standard browser 404 page and I'd like to design and implement something different. However, does anyone have any ideas how I could go about doing this? I've had a search around online but so far haven't found anything very definitive. I guess a lot of it depends on my current server setup??

    Cheers,

    Shoxt3r

  2. #2
    Foozle Reducer ServerStorm's Avatar
    Join Date
    Feb 2005
    Location
    Burlington, Canada
    Posts
    2,699
    Mentioned
    89 Post(s)
    Tagged
    2 Thread(s)
    Hi Shox3r,

    Do you use Apache or IIS for your Web Server? If using Apache you do something like this

    It is generally a good idea to give the user an option to get back to a 'good' page like index.html or home.html; you can provide a link or you can redirect them to a good page after a reasonable time has past for them to read your error page info.

    Steve
    ictus==""

  3. #3
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,605
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    Shox,

    I've not seen SS's link but have something in my signature's mod_rewrite tutorial.

    Two additional points:

    1. There was a recent thread in which Ralph and I went back and forth about techniques on 404 redirections. We said the same thing but I added a meta (timed) redirection statement to a page which notified the visitor for the reason for a redirection then redirecting to a 404 handler script (or, simply, a sitemap) which the visitor can use to link directly to the requested page (using a correct link).

    2. mod_speling can correct capitalization errors as well as minor typos when a visitor relies on entering your link by hand.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  4. #4
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your replies. I believe that my Web Server is running on Apache (I pay for hosting from Streamline.net).
    I remember asking the support team at Streamline about accessing the htaccess file and below was their response.

    Thank you for your query

    We just want to inform you that we only support mod rewrite on htaccess.
    So I guess that points to what you are saying DK?

  5. #5
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,605
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    Shox,

    Upload a file with one line: <?php phpinfo(); ?> then save that page (so you can refer to it later) and DELETE that file from the server (you don't need to help hackers by providing all that information). The phpinfo() output will contain information about your server, active modules, etc., i.e., a wealth of information.

    No, I interpret their response to say that they will not enable mod_speling on your server (shame on them!).

    The nature of the .htaccess file is that it can contain all sorts of Apache directives so "only support mod_rewrite on .htaccess" is bogus.

    Regardless of their position on mod_speling, I believe that you can use mod_rewrite to redirect 404s (i.e., !-d and !-f ... if you don't understand that notation, look at the link in my signature) to a "Whoops Page" telling visitors their requested link is unavailable and that you're redirecting to ... (a) your sitemap script or (b) a script which can read the original {REQUEST_URI} (even if it had to be appended to the redirection(s) as a query string) to try to guess the visitor's intent or (c) your Home Page (which should have valid links to your website).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  6. #6
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great! Thanks for your reply, will look into all of this and report back


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
  •