Results 1 to 1 of 1

Thread: 404 Error page

  1. #1
    Join Date
    Feb 2007
    Location
    🌎
    Posts
    528
    Thanks
    10
    Thanked 10 Times in 10 Posts
    Blog Entries
    2

    Angry 404 Error page

    I am currently working on my 404 error page, and regular expressions are giving me a headache. (/^(\http\.*whatever.)
    I need a script that does the following. Regular expression segments are bolded. Please make all instances of mysite into a variable.

    If window.location is equal to
    http://www.mysite.com
    OR
    http://www.mysite.com/
    document.write the following:
    <strong>http://www.mysite.com/</strong>

    If window.location is equal to
    http://www.mysite.com/.+ that does not end with / or \.\.+
    AND
    window.location is not equal to
    http://www.mysite.com/errors
    document.write the following:
    <strong>window.location + "/"</strong>

    If window.location is equal to
    http://www.mysite.com/.+/ that ends with /
    AND window.location is not equal to
    http://www.mysite.com/.+\.\.+\/\/
    document.write the following:
    <strong>window.location</strong>

    If window.location is equal to
    http://www.mysite.com/.+\.\.+
    document.write the following:
    <strong>window.location</strong>

    If window.location is equal to
    http://www.mysite.com/errors/.*
    OR
    window.location is equal to
    http://www.mysite.com/errors
    redirect the user to
    window.location with a capital 'E' in 'errors'.

    If window.location is equal to
    http://www.mysite.com/.+\.\.+\/\$/
    redirect the user to
    window.location without the trailing '/'.

    If none of the above are true
    document.write the following:
    <strong>window.location</strong>
    Last edited by techno_race; 06-27-2008 at 10:59 PM.
    ....(o_ Penguins
    .---/(o_- techno_racing
    +(---//\-' in
    .+(_)--(_)' The McMurdo 500

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
  •