Forum Moderators: phranque
I guess it's caused by me accidently making an internal link or someone else made an external link.
I don't see any of these pages indexed and I don't know if they could be but that's what I'd like to prevent.
I see that mysite.com./mypage.html is different from mysite.com/mypage.html as far as one having pr and the other does not.
So should I try to use .htaccess to remove the ./?
Thank you.
Note that the trailing period *is* linked, and *will* be used as the URL. You will also note that google detects this and redirects to fix the error. (Correction: Ooops! No they don't! So you are not alone.)
If you do not use subdomains, or if you use only the single "www" subdomain, then this "standard" domain canonicalization code, placed in example.com/.htaccess, will clean up the search results while you try to find that non-canonical link:
# If requested domain is not blank and is not exactly "www.example.com"
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
# redirect to the same URL-path in www.example.com domain
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Allowing for a blank HTTP host header allows this code to be used on servers which support now-very-rare HTTP/1.0 requests. This feature will not get invoked often, but without it, an HTTP/1.0 request (which will not include a Host header) would cause an infinite redirection loop.
If you have no other mod_rewrite rules, then you will need to add the following two lines, or only the second of these two lines, placing them ahead of the two lines above (the only way to find out if the first line is needed, not needed, or not allowed on your server is to test):
Options +FollowSymLinks
RewriteEngine on
[edited by: jdMorgan at 12:01 am (utc) on Aug. 8, 2008]