Forum Moderators: phranque

Message Too Old, No Replies

Header image not showing up

appropriate images show on all other pages though

         

neophyte

6:12 am on Mar 20, 2006 (gmt 0)

10+ Year Member



Hi all -

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]

le_gber

2:49 pm on Mar 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



have you tried using: <img src="http://www.mysite.com/path/to/image.gif>

Tastatura

4:36 pm on Mar 20, 2006 (gmt 0)

10+ Year Member



As was already pointed out, make sure that path and image name are correct. Also I would make sure that image extension is also identical (in picture name and in the page code) – what I mean is that if you have a picture named ‘mypic.JPG’, and from your page you call it (in IMG tag) as ‘mypic.jpg’, (notice upper and lower case difference in extension) you might experience problem that you are describing (image not showing but info in ALT tag is visible).
HTH

stapel

5:13 pm on Mar 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Note: The 404 page can be called from anywhere within your site. This means that all links in the 404 page should be absolute, since relative links will be messed up if the error page is called from a location that doesn't fit with the relative links.

For instance, your structure might be something like:

    index.htm
    404error.htm
    /images/header.jpg
    /some_directory/filename.htm

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.

neophyte

1:49 am on Mar 21, 2006 (gmt 0)

10+ Year Member



Stapel:

>>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

le_gber

9:58 am on Mar 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



now that you can see your image try:

<img src="/path/to/image.jpg" />

if this works, put / in front of all your links in the 404 page (that way if someone type www.yourdomain.com/somedir/filenaem.htm it will still work)

I just noticed that it's what stapel told you to do

stapel

3:45 pm on Mar 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



neophyte said:
I just tried what you had said...and now the header image shows with the absolute reference. Cool.

Excellent!

Then neophyte asked:

But...all my other links within this page ARE relative and they do work.

The "working" or "not working" will, to some extent, depend on how the various pages are related to each other. For instance, if the problem with the header image was due to the "images" directory being in an unexpected place ("unexpected" as far as the 404 error page's coding was concerned), then the absolute link will "fix" that problem.

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.

neophyte

3:23 am on Mar 22, 2006 (gmt 0)

10+ Year Member



With the exception of the home index page, I've got all individual pages - including the error page and it's image assets - in their own directory, like this:

_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