Forum Moderators: DixonJones
I am very new to log analysis but because of this problem I am trying to make some sense of the results and I just hope that someone on this forum can help me. I was looking in my logfiles to see if I could find any evidence of traffic to my domain name without the www and I found many results like the three examples below. These all refer to my domain without the www. Can this be causing my problems? If so how do I stop this?
209.237.238.174 - - [15/Feb/2004:00:00:13 +0100] "GET /robots.txt HTTP/1.0" 301 233 mydomainname.co.uk "-" "ia_archiver" "-"
209.237.238.174 - - [15/Feb/2004:00:18:07 +0100] "GET /apageonmysite.html HTTP/1.0" 200 25972 mydomainname.co.uk "-" "ia_archiver" "-"
209.237.238.159 - - [15/Feb/2004:02:43:17 +0100] "GET /Assets/Images/animageonmysite.jpeg HTTP/1.0" 200 10865 mydomainname.co.uk "-" "ia_archiver" "-"
Any help would be greatly appreciated.
> If so how do I stop this?
It could be a good idea to decide to appear with one URL type only, and there are several ways to do it:
In your case your webserver is accepting more than servername for the same DocumentRoot. Probably you have configured a ServerName and a ServerAlias, or wildcard subdomains.
If you have access to your httpd.conf, the hard way would be just to drop the ServerAlias or the wildcard subdomains.
<VirtualHost *>
DocumentRoot /home/example-com/www
ServerName www.example.com
ServerAlias example.com
A probably better way would be to accept the bare "example.com" but rewrite it to "www.example.com".
You could do this in your /.htacces
# rewrite example.com/... -> www.example.com/...
RewriteEngine on
RewriteCond %{http_host} ^example\.com
ReWriteRule ^(.*)$ [example.com...] [R=301,L]
So even your lazy users would get thru without errors after being smoothly redirected to the correct pages.
If you are not in control of your setup like shown above, you are lost, but you should consequently check all your own links on your own pages to explicitly address the "http://www..." version of your URL instead of relative links "/index.htm", so that users moving around on your site get onto the "right" track after their 2nd request.
And also ask other webmasters to explicitly link to your pages in the way you want.
Regards,
R.