Forum Moderators: phranque

Message Too Old, No Replies

I see a ./ as a Referrer

what does it mean and how do I fix it

         

proboscis

11:26 pm on Aug 7, 2008 (gmt 0)

10+ Year Member




I see a ./ as a referrer in my logs, also I see most of my pages slowly being added as referrers with a ./ for example I see ./mypage.html

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.

jdMorgan

11:59 pm on Aug 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Someone has linked to the valid, but non-canonical "example.com." domain. This often happens when a domain is "auto-linked" by popular forum software, and it occurs at the end of the poster's sentence. For example, "I found this great new search engine! -- See [google.com....] "

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]

Note that you can use this for the "non-www" example.com as well, as long as you change both lines -- escaping the literal periods in the RewriteCond pattern as shown.

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

Jim
[edit] Correction as noted in text above. [/edit]

[edited by: jdMorgan at 12:01 am (utc) on Aug. 8, 2008]

proboscis

12:20 am on Aug 8, 2008 (gmt 0)

10+ Year Member



Ah ha! That appears to work like a charm. Thank you :)!