<br><br><div><span class="gmail_quote">On 31/01/2008, <b class="gmail_sendername">Dennis Kubes</b> &lt;<a href="mailto:kubes@apache.org">kubes@apache.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
We are currently working on URL normalization measures for the search<br>wikia crawls.&nbsp;&nbsp;URL normalization is used during crawls to change URLs<br>into standard forms.&nbsp;&nbsp;An example of this is have <a href="http://www.site.com/index.html">www.site.com/index.html</a><br>
and <a href="http://www.site.com/">www.site.com/</a> resolve to the same URL for crawling and scoring purposes.<br><br>Eventually the idea would be to allow normalizations on a per domain<br>basis and allow the community to give detailed feedback per domain.<br>
Currently all normalizations are on a global basic.&nbsp;&nbsp;Our current url<br>normalizations are done through regex so I have included the current<br>expressions as well.&nbsp;&nbsp;Currently we have come up with the following<br>normalizations, is there anything else we should include, change?&nbsp;&nbsp;What<br>
does everyone think?</blockquote><div><br>1.&nbsp; Session id elimination.<br>&nbsp;&nbsp; <br>&nbsp; &nbsp;&nbsp; Is this wise? If you eliminate the session id&nbsp; from a URL then the server is<br>&nbsp; &nbsp;&nbsp; likely to respond with a completely different page that represents the start<br>
&nbsp;&nbsp;&nbsp;&nbsp; of a new session. This may result in the user seeing something quite <br>&nbsp;&nbsp;&nbsp;&nbsp; different to what the search engine sees which may be confusing. <br><br>2.&nbsp;&nbsp; Pages served for directory requests.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I have also seen &quot;welcome.htm[l]&quot; and &quot;home.htm[l]&quot; used in this context.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; However I think doing this sort of normalisation is unwise and agree with<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Balinny that you need to access the actual pages. However a typically<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; configured Apache server will not return a &quot;Content-Location&quot; header, it<br>
&nbsp; &nbsp; &nbsp; will simply and silently return &quot;index.html&quot; when you&nbsp; request the directory.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [I think, but I&#39;m not sure, that MS IIS does return a &quot;Content-Location&quot; header.]<br><br>&nbsp; &nbsp; &nbsp; So I&#39;m afraid you&#39;ll have to fetch both &quot;/&quot; and&nbsp; &quot;/index.html&quot; and determine<br>
&nbsp; &nbsp; &nbsp; that they&#39;re the same by checksumming or content inspection.<br><br>3.&nbsp;&nbsp;&nbsp; Removal of fragments (the bit after the #)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Yes, of course, but remember, and the regex quoted doesn&#39;t, that this may<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; interact with the dynamic part of the URL (the bit after the &quot;?&quot;). I would<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; assume that the fragment part of the URL is terminated by the &quot;?&quot; if a<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dynamic part (or query) is present.<br>
<br>4.&nbsp;&nbsp;&nbsp; Collapse multiple ampersands (&amp;amp;) to a single ampersand.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Can&#39;t see why.<br><br>5.&nbsp;&nbsp;&nbsp; Removal of initial &amp; after ?<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I.e. ?&amp;var=.... -&gt;&nbsp; ?var=....<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OK if you really want to, personally I&#39;d prefer to ensure that there was<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; an ampersand in this position as it makes it slightly easier to parse the<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dynamic part if you really want to.<br><br>6.&nbsp;&nbsp;&nbsp; Remove trailing ?<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If it&#39;s all on its own, seems sensible - but check with server, it just might<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do something insufferably clever.<br><br>Some extra suggestions<br><br>7.&nbsp;&nbsp;&nbsp; Encoded characters<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Map + to space (RFC1630), Map hex encoded non-reserved characters to<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; their non-encoded equivalents.&nbsp; [E.g. %7e -&gt; ~ see RFC3986]<br>
<br>8.&nbsp;&nbsp;&nbsp; Leading double dots etc.,<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Do something coherent with URLs that start .././ and the like. Again see RFC3986<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for detailed discussion. This is associated with the process I call derelativisation,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i.e. converting a relative URL to an absolute URL.<br><br>9.&nbsp;&nbsp;&nbsp; Care with case<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If the server is Unix/Linux based then URL case must preserved since the underlying<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file naming system is case sensitive. On Microsoft based servers file naming is not<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case sensitive, so if server signature analysis (the Server header) suggests a <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Microsoft based host then MYPAGE.HTM and mypage.htm can be regarded as<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; being the same.<br><br>10.&nbsp;&nbsp; Order of dynamic parts.<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In general the order of the variable settings in the dynamic part of a URL is<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unimportant. I.e. bigsite?&amp;chap=23&amp;page=11 and bigsite?&amp;page=11&amp;chap=23<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; will both refer to the same document. This requires parsing the dynamic part<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and comparing the sequence.<br><br><br>General point.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I think it would be better to retain all the URLs in the database and associate<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; an arbitrary document identification with them. So 2 (or more) URLs that redirect to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; or refer to the same document will retain their distinctiveness but will all be associated<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with the same document. This mechanism can support both HTTP and meta tag<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; redirection.<br><br></div><br>
</div><br>