Forum Moderators: phranque
I should start off with "I am not a server techy". Although I am as paranoid as the next man about server problems and, more to the point, how to avoid them.
I have been looking recently at my logs on a newly built Linux server. There is something peculiar that I have not seen before.
I find the a page like: www.xsomething.com/directory/ is there as normal.
But, when I look at: www.xsomething.com//directory/ or www.xsomething.com//directory// the same page appears.
I have looked on other sites and they seems to have similar. Yet I have never noted any visits to these urls before.
Does anyone know if this causes problems with search engines? I am thinking along the lines of www and non www issues.
As far as concern about duplicate content caused by this, I'd put it in the 'minor concern' class. You might want to look through some search results to see if you can find a double-slashed URL in the results listing -- I don't think I've ever seen one, but then, I don't recall ever looking.
As usual, a bit of mod_rewrite can be used to fix it if it is ever a problem:
# Remove extra slashes in URL
RewriteCond %{REQUEST_URI} ^(.*)//+(.*)$
RewriteRule . http://www.example.com%1/%2 [R=301,L]
A more complex solution is needed to fix multiple occurrences of double-slashes in one URL using only a single redirect, but this occurs so rarely that I hardly ever bother with it.
Also, the "double dot-star" type of pattern used here is notoriously inefficient processing-wise (matching such patterns can require hundreds of re-tries by the regex parser depending on requested URL length and content), so I prefer to use it only if actually needed.
Jim