Forum Moderators: phranque

Message Too Old, No Replies

Error Pages - Absolute Links Required?

         

neophyte

12:39 am on Aug 4, 2006 (gmt 0)

10+ Year Member



Hello All -

I've got an error page with relative links to all the pages in a particular site. As planned, the error page will always come up if a url is mispelled (etc).

What's wierd is, sometimes my links - to navigate back into live pages - work, and sometimes they just don't.

Like this: I'll misspell something in the following url:

Admin, please note below URLS are bougus for illustration purposes.

1. [somesite.com...]
2. The error page will display
3. I click on the "Objective" link (or some other) to get back into a live page
4. nothing happens, and the adress bar now reads:
[somesite.com...]

Wow, that's wierd, isn't it?

Is this because I've got my links back into the site "relative" instead of absolute? On error pages should one ALWAYS have absolute link references?

Neophyte

encyclo

1:17 am on Aug 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As the custom error page can be triggered at any directory level of your site, you must always have links which either reference the document root or which include the full URL including the domain name.

For example:

<a href="/objective.htm">Objectives</a>

Otherwise the user agent will have to try to resolve links relative to the erroneous page. What would happen if you had a bogus link such as this?:

http://example.com/a/b/c/d/e/f/g/h/i/j/k/l/page.htm

neophyte

5:23 am on Aug 7, 2006 (gmt 0)

10+ Year Member



Encyclo -

Thanks for the clarification. Sorry to sound like such a newbie (which I'm really not but this is the first time I've delt with this issue) but when you say the "document root" what does that mean?

Right now I've fixed the problems with:

[somesite.com...]

and everything works fine; but if I wanted to reference the "document root" rathern than the entire URL like I'm doing now, would that be this:

/current/more_current/landing_page.htm ?

Appreciate your guidance.

Neophyte

coopster

11:52 am on Aug 7, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Correct. Did you try it? Apache DocumentRoot [httpd.apache.org] is where you can read more.