Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Senior Member Tony Hardy's Avatar
    Join Date
    Dec 2010
    Location
    Newcastle, England
    Posts
    763
    Thanks
    2
    Thanked 19 Times in 16 Posts

    Custom 404/Error Page

    Hey everyone.

    So I'm trying to make a custom 404 page, and I've got it working for the most part, it can be found here:
    Tasty Treats - Not Found - Sweets, Pop, Biscuits and Confectionery Shop - North East England
    It works when linking to a page that doesn't exist, such as;
    http://www.tastytreats.org.uk/thispagedoesnotexist.html

    However, once a slash is added after the HTML, it doesn't work.

    Any ideas?

  2. #2
    Senior Member
    Join Date
    Aug 2009
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Tony Hardy View Post
    However, once a slash is added after the HTML, it doesn't work.
    The page works, nothing on it does. It is trying to find everything in the wrong places. Read up on "absolute" and "relative" URLs and come back. I'll give you a clue - your css file is not at "http://www.tastytreats.org.uk/thispagedoesnotexist.html/css/styles.css" but at "http://www.tastytreats.org.uk/css/styles.css."

  3. #3
    Senior Member Tony Hardy's Avatar
    Join Date
    Dec 2010
    Location
    Newcastle, England
    Posts
    763
    Thanks
    2
    Thanked 19 Times in 16 Posts
    I understand absolute and relative URL's, yet I still don't understand what's causing the error?
    My NotFound page works when it doesn't have a slash at the end, but when it does it doesn't? How can an absolute/relative issue be causing this?

  4. #4
    Senior Member dedwardp's Avatar
    Join Date
    Aug 2010
    Location
    Colchester & Nottingham
    Posts
    417
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Quote Originally Posted by Tony Hardy View Post
    I understand absolute and relative URL's, yet I still don't understand what's causing the error?
    My NotFound page works when it doesn't have a slash at the end, but when it does it doesn't? How can an absolute/relative issue be causing this?
    I think that by adding the / at the end, the page is loading as though it is a new directory. Therefore, from the new directory, the css file would then be found at "../css/style.css" say, rather than just "css/style.css".

  5. #5
    Senior Member Tony Hardy's Avatar
    Join Date
    Dec 2010
    Location
    Newcastle, England
    Posts
    763
    Thanks
    2
    Thanked 19 Times in 16 Posts
    So is there a fix? Or because it'll always think it's looking in a new directory with a slash then it'll always produce an error?

  6. #6
    Senior Member Tony Hardy's Avatar
    Join Date
    Dec 2010
    Location
    Newcastle, England
    Posts
    763
    Thanks
    2
    Thanked 19 Times in 16 Posts
    Well, I've got it to work, by putting the "/" in the link to the CSS. But now, none of the links work?
    Last edited by Tony Hardy; 08-16-2011 at 08:24 PM.

  7. #7
    Senior Member dedwardp's Avatar
    Join Date
    Aug 2010
    Location
    Colchester & Nottingham
    Posts
    417
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Not completely sure on that one, sorry!

  8. #8
    djb
    djb is offline
    Senior Member djb's Avatar
    Join Date
    Apr 2010
    Location
    Farnham, Surrey
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You need to make all the links on the 404 page absolute rather than relative.

    So the link to the homepage would be

    Code:
    http://www.tastytreats.org.uk/index.html
    rather than just

    Code:
    index.html
    That way, no matter at what directory level the 404 page is showing at it always knows exactly where everything is by following the absolute, unchangeable web address.*

    *I think
    Last edited by djb; 08-16-2011 at 08:28 PM.

  9. #9
    Senior Member Tony Hardy's Avatar
    Join Date
    Dec 2010
    Location
    Newcastle, England
    Posts
    763
    Thanks
    2
    Thanked 19 Times in 16 Posts
    I think I've done it, I also had to have the link to the .css page with a slash in front of it so it could find that too at every level (I think)?

    Is it working for you guys? :)

  10. #10
    Senior Member dedwardp's Avatar
    Join Date
    Aug 2010
    Location
    Colchester & Nottingham
    Posts
    417
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Works for me! :)

Page 1 of 2 12 LastLast

Similar Threads

  1. Business card printing error
    By squeezee in forum Printing & Print Design Forum:
    Replies: 10
    Last Post: 11-24-2011, 07:26 AM
  2. InDesign CS3 Help: Error Code 3
    By Green Sheep Design in forum Adobe Forum:
    Replies: 1
    Last Post: 05-05-2010, 06:52 PM
  3. Flash CS4 GIF Publishing error
    By adamhook in forum Adobe Forum:
    Replies: 0
    Last Post: 11-23-2009, 04:05 PM
  4. Great 404 Error Pages
    By Boss Hog in forum Website Design Forum:
    Replies: 6
    Last Post: 04-06-2009, 09:08 AM
  5. Error Message
    By Pixels Ink in forum GDF Feedback & Help:
    Replies: 3
    Last Post: 03-30-2009, 08:42 AM

Posting Permissions

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