Forum Moderators: phranque
Have just created a 404 error page for a client's site. All is well when you type in a url that doesn't exist - all error page content shows as expected - including minor images. BUT, the header image isn't showing. It's alt tag is, but not the image. Wierd.
I've checked and re-checked the path to this image, no problem. Have cleared my cache, etc, but still no dice.
Anybody got any ideas?
Go here to see it: <snip>. That'll serve up the error page. As you'll see, everything is there except the header image.
All guidance greatly appreciated.
Neophyte
[edited by: trillianjedi at 12:02 pm (utc) on Mar. 20, 2006]
[edit reason] No URL drops please as per TOS #13 ;-) [/edit]
For instance, your structure might be something like:
If your 404 page has relative links that "work" in its given location, then it won't display the header image when a user mistypes and asks for, say, fielnaem.htm.
This is because the relative link within your 404error.htm page is expecting the header.jpg image to be located one level down from its current location, in the images folder. But since the 404 error is being generated from within the same-level some_directory folder, the relative link doesn't work.
Eliz.
>>If your 404 page has relative links that "work" in its given location, then it won't display the header image when a user mistypes and asks for, say, fielnaem.htm.
I just tried what you had said - as well as le_gbr - and now the header image shows with the absolute reference. Cool.
But...all my other links within this page ARE relative and they do work. So, what's the "correct" thing to do? Should I change all outgoing links from the 404 page to absolute as well?
Thanks to EVERYONE who responded. This is my first stab at an error page and I was really flustered at the problem with the error page.
Neophyte
I just tried what you had said...and now the header image shows with the absolute reference. Cool.
Then neophyte asked:
But...all my other links within this page ARE relative and they do work.
But how are the other pages to which you link on the error page related to the error page? If they're all on the same "level" (within your directory structure), then the relative links will be okay.
It's my understanding that absolute links are safest. I welcome corrections.
Eliz.
_error (section directory)
-- i (image directory inside the _error directory which contained the header image)
-- error.htm (inside the _error directory)
I just tried something else regarding linking the header image and that works too:
instead of [somedomain.com...] (which worked), I did this:
/_error/i/error_header.jpg (which also works).
My confusion was that I couldn't understand why i just couldn't use the path /i/error_header.jpg as error.htm is in the root of the _error directory along with the I directory. I guess it's because, like you had mentioned, the error page can be called from anywhere within the main root so it need to know what directory(ies) to look for the header graphic in.
Interesting and enlightening.
Anyway, both ways work and I'm grateful for that... as well as everyone's guidance here on this particular issue.
Neophyte