Re: Making Net_URL2 Stable
| From: | Bertrand Mansion | Date: | Sat, 23 Jul 2011 13:04:01 +0000 |
| Subject: | Re: Making Net_URL2 Stable | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-54413@lists.php.net to get a copy of this message | ||
Hi Alexey,
For me, it means that browsers normalize /../, but not // and web
servers internally normalize // to / by default (ex:
http://sysoev.ru/nginx/docs/http/ngx_http_core_module.html#merge_slashes
).
I also read that Google will index both the // and the / version, each
with a different pagerank !
In the end, it probably depends on what you want to use Net_URL2 for.
Maybe having an option to merge slashes would be interesting. Some
other libraries in other languages normalize // to / , optionally or
not, for example :
- https://github.com/jashmenn/url-normalizer
(closure)
- http://intertwingly.net/stories/2004/08/04/urlnorm.py
(python)
There is also an article on Wikipedia about url normalization that
mentions converting // to /:
- http://en.wikipedia.org/wiki/URL_normalization
RFC3986 also allows an url with no host part, for example
file:///path/to/file, that's why there is this leading /
Keeping // in the url doesn't seem clean even if it is not clearly
documented in the RFC. It is not useful and can probably lead to
unexpected side effects (google indexing the // version being one of
them). But I'm not maintainer on this package, so I'll leave that up
to them.
Cheers,
Bertrand