404 error page problems
I have a customised 404 page for my site which works fine and shows all jpgs/giffs if error occurs in main page. However, if a 404 error occurs in a subdirectory the pages shows but the jpgs/giffs are missing. Does this mean I have to put the icons in each directory, or is there another solution?
Thank you for the input
Cheers,
Steven
Suzanne posted this at 04:01 — 26th October 2003.
She has: 5,507 posts
Joined: Feb 2000
Use full absolute urls for all links and images in a 404 page.
sredhead posted this at 06:25 — 26th October 2003.
They have: 11 posts
Joined: Aug 2003
Hi Suzanne,
Thank you for your reply. Sounds interesting, but what are 'full absolute urls' that I should use on the 404 page? A quick idea on how to do this would be most helpful if you have the time and it is not too much to ask. All the jpgs/giffs for the 404 page are all in the master directory.
Cheers,
Steven
Thank you for the input
Cheers,
Steven
sredhead posted this at 06:28 — 26th October 2003.
They have: 11 posts
Joined: Aug 2003
Hi Suzanne,
Do you mean rather than putting .../images/header.jpg I should put http://stevenredhead.com/images/header.jpg? If so it's easy and thanks for the idea.
Steven
Thank you for the input
Cheers,
Steven
Suzanne posted this at 19:21 — 26th October 2003.
She has: 5,507 posts
Joined: Feb 2000
Yes, that's exactly what I mean.
../images/header.jpg means "go up one directory, then over to images folder and get header.jpg".
If you're any deeper in, you'll get missing images.
You can also use relative to root urls (also called absolute urls, annoyingly):
/images/header.jpg
Which says, from the main level, go to the images folder and get the header.jpg. You won't run into any broken images that way, but it can cause issues for poorly written spiders (who are the most often visitors of 404 pages).
Therefore, I suggested using full absolute urls -- http://yourdomain.com/images/header.jpg which is not as friendly if you change domains, and carries a slight code and server penalty because it must look for the domain first and then the folders, but prevents worse problems.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.