Joshua's assertion is correct, in that altering the URL is dangerous. 
For example:

> 1) remove leading www. from host

In many environments where DNS is hosted internally, as is the case in
most corporate networks, there is a significant chance that
www.foo.com and foo.com point to different resources.  Most commonly,
they point to the public website and then the intranet, respectively. 
Additionally, there still exists many websites that do not route
foo.com to their webserver (as whoever manages the DNS did not bother
to point foo.com to the right resource).

> 2) remove trailing #fragment

For large documents, the # anchor is almost as important as the base
URL itself, in pointing to the proper resource.  In practice, this
usually applies to long legal documentation/legislation dumped to HTML
straight from a Word document.

> 3) remove trailing index.(html|shtml|php)

This is dangerous because you cannot assume that index.* points to the
same resource.  When configuring a webserver, you specify the
DefaultDocument with one or more file names, i.e.,

    DefaultDocument index.html index.aspx index.php

The most common scenario is that index.html is a poorman's "sorry
page", so when it's present in the file system, the webserver returns
a "down for maintenance page".  When absent, it serves the index.aspx
page.

Albeit rare, another scenario is that the webserver directs traffic to
different resources according to IP, so it serves index.aspx for
foreign IPs, and index.php for internal IPs (again, an
internet/intranet switch scenario).


I would recommend a soft suggest system, like Google's spell checker,
which prompts the user when a similar URL exists in the system.  For
instance, when trying to bookmark this:

    http://www.foo.com/index.php#top

delicious would add the following suggestion:

    Did you mean to bookmark "http://foo.com/"; (324 other users)?

That way, you can 1) have a human evaluate the veracity of the
alternate link, and 2) tap into the whole "wisdom of the crowds"
thing.

- Johnvey
http://johnvey.com


On 8/26/05, joshua schachter <[EMAIL PROTECTED]> wrote:
> I hold it as some sort of sin to mangle the user's submitted data. So
> we will not irrecoverably change your url if at all possible (modulo
> the dangerous# thing.)
> 
> I think what people are actually talking about are a) if you
> bookmarked www.xyz.com/index.html and  if you try to submit xyz.com/
> some other time, it should somehow catch that and b) correctly
> showing the "and n other people" stuff. I believe the second can be
> accomplished easily enough, but a) is quite dangerous.
> 
> In general the transformations are:
> 1) remove leading www. from host
> 2) remove trailing #fragment
> 3) remove trailing index.(html|shtml|php)
> 
> I plan to add something like this, but it will not go in until it is
> properly thought through.
> 
> Joshua
_______________________________________________
discuss mailing list
[email protected]
http://lists.del.icio.us/cgi-bin/mailman/listinfo/discuss

Reply via email to