WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Duplicate links...

for

From: Jukka K. Korpela
Date: Jun 9, 2006 4:20AM


On Wed, 7 Jun 2006, Stephanie Sullivan wrote:

> The only thing I see is the opposite... He has DIFFERENT link text to one
> URL that is the same...
>
> Top:
> <a href="/legal/" class="p7PMtrg" id="n7">Legal</a>
>
> Bottom:
> <a href="/legal" title="terms of use for this website">Terms of Use</a>

They do _not_ use the same URL. The relative URLs "/legal/" and "/legal"
are not identical, and when resolved to absolute URLs, the results are
not identical either. Remember: URLs are just strings that may be used to
retrieve a resource.

The URLs "/legal/" and "/legal" _may_ refer to the same resource, even in
the strict sense (as opposite to the fact that exactly the same content
may appear as copies as distinct resources). For example, a server may
respond to a request for "/legal" with a temporary or permanent
redirection to "/legal/" (which itself might be redirected to
"/legal/index.html" for example). The URLs are still distinct; they are
different names for a resource, at least in a particular situation.

On quite similar grounds, "/legal/" and "/laillinen/" or "/foobar/zap/zip"
or "foo" _may_ all refer to the same resource.

The point is that by looking at the HTML source alone you cannot decide
whether "/legal/" and "legal" refer to the same resource, still less
whether they refer to the same content (e.g., two resources with content
copied verbatim from one to another). A checker could decide on the "same
resource" issue only by resolving the relative URLs and sending actual
HTTP requests and analyzing the headers of the responses. In order to
decide on the "same content" issue, there is really no way - the checker
could send GET requests and compare the actual content it receives (doing
redirection as needed), but this would as such be just a snapshot. The
pages could be identical now and completely different the next second.

As a human reader who looks at the source code, you are of course entitled
into the suspicion that there might be links to the same resource with two
different URLs and two different link texts. I would actually bet at least
1 : 5 for it.

> (and this one has the trailing slash on one and none on the other... I think
> he was testing it)...

Maybe. Maybe it was just a minor inconsistency. Generally, it is best to
avoid such usage, but there is nothing formally wrong with it, and no
explicit accessibility recommendation against it either. Users seldom get
confused, since although they might see two different URLs on the status
when they mouse over links, they will see the ultimate resultant URLs
(after any redirections) on the address (location) line, and most people
look at it much more than the status line.

Of course, it's a completely different question whether a page could
contain "duplicate" links that refer to the same document or the same
content with different or same URLs or different or same link texts, for
some values of "same" and "different". I feel dizzy now and won't comment
this topic now except by saying that I once thought it is nice to have
several links to the same page on one page, in order to make it easier to
people to find that important page, but now I think the idea was wrong.

--
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/