Well, you can call me pedantic, because of writing a whole blog entry about this, but I think it’s important. We are web designers, so we should care about every little thing that helps us improve our websites.
I noticed that most people do not worry about what to link to, when linking to the home page of their sites. That’s a big mistake, I think. Let me explain what I mean. Normally, you have a link back to the entry site of your website. Often it’s titled “home”. But where do you link to? A little case study:
- The CSS Vault links to “http://www.cssvault.com/”, but that will always redirect you to “http://cssvault.com/”
- Dave Shea links to “/”.
- Jeremy Flint links to “/wp/index.php”
- Yellowlane links to “http://www.yellowlane.com/”
- Anil Dash links to “index.php”
So, where’s the point? Well, in the worst case you can make three sites out of one. The visitors will still see one site, but search engines will think there are three.
I’ll take my URL as an example.
If you got “http://www.julian-bez.de/” you can make three sites out of it:
- http://www.julian-bez.de/
- http://www.julian-bez.de/index.php
- http://julian-bez.de/
A search engine will see three completely different addresses. No one will – hopefully – set a link to your site containing a “index.php”, or something like that, so don’t do the mistake yourself.
Don’t link to “/index.php”
There’s another problem, which I think should be mentioned. Do we need a “www” or not? Some people let their visitors decide, and support them in their choice. I take mezzoblue as an example. The “home” link will take us always to “/”. That could be “http://www.mezzoblue.com/” OR “http://mezzoblue.com/”. Google has indexed both.
I’m constantly trying to avoid this problem by linking straight to the whole URL. If Dave wouldn’t want someone to use “http://mezzoblue.com/” he could’ve set the “home” link to “http://www.mezzoblue.com/”, instead of “/”. That doesn’t prevent the usage of the non-www address, but the reader could notice, what should be used. For instance “What Do I Know” does so. Todd links to “http://whatdoiknow.org/”, what means he doesn’t want the “www” to be used. If I go to the site using “www” and later click on “home” and then bookmark it, because it’s nice, I won’t have the “www” in the bookmark.
What I want to say is: Don’t make multiple sites out of one. Avoid using “index.*” and link to the full URL.
To prevent the usage of “/index.php” on my site I have a PHP script on the entry page which examines if the user agent is looking for “index.php”. If so, it’ll send a “Location:” header. No robot will ever index “index.php”. Ha!
if(strstr($_SERVER['REQUEST_URI'],'/index')) {
header('Location: http://www.yourdomain.com/');
}
Update: Read also the follow-up www or not.