Helping people with computers... one answer at a time.
As the owner of a web site there are plenty of decisions to make. One of the first is whether to standardize on including "www" or not.
You refer to your site as "http://ask-leo.com" without the "www" in front. But most other sites almost always include the "www". And "http://www.ask-leo.com" works, but sends me to "http://ask-leo.com".
I'm confused - when I talk about my own site do I use "www" or don't I? Why don't you? In fact, why and how do you force it not to even when people use "www"?
I've mentioned it before: when entering a URL into a browser in most cases the www is optional. Unless a site has something instead of "www", most sites work either way. As you note, both http://ask-leo.com and http://www.ask-leo.com work and send you to the same place.
But when you create links to and within your web site you want to choose one style and stick with it.
In fact, if you can you want to force the style you picked as much as possible.
I'll explain why that is, and why I picked what I did.
Here's the deal: very technically
are two different pages.
They're as different as if they'd been on two completely different sites. The fact that they have the same content - and might actually be the same page - doesn't really mean much. Since the URLs are different they are again, very technically, two completely separate pages.
It doesn't matter to your visitors - they see what they see, and that's probably the same on both.
It matters very much if you care about your position in search results.
As you're probably aware incoming links to your page is one of many criteria that the various search engines use to determine how important or relevant your page is in relation to specific search terms. To grossly over simplify the more incoming links the more important your page must be. (This is one of the reason website comment spam exists - it's an attempt to place incoming links.)
That means you want the search engines to see all those links going to the same page - not some links to one (with "www") and some links to another (without). Some search engines might be smart enough to realize that they're the same page (it is extra work, since they actually could legitimately be different pages), but many are not.
The take-away: "www" or no "www" - pick one and stick with it. Make sure all references that you create to your own website pages follow your choice.
I'm a purist and the way "www." is used these days is redundant and unnecessary and silly and just takes up more space and more syllables in everything you say, print, write and type. So why use it at all?
Even acknowledging that people expect "www", are use to it, and CTRL+Enter in a browser address bar types it in for you, these points are completely moot as long as www.ask-leo.com eventually lands you on ask-leo.com without the www. That means that people can use it if they want, you'll just ensure that they end up on to the right place.
Particularly these days people know that just about anything ".com" means that's a website and they'll do the right thing (or their browser will for them).
Now, knowing now what I didn't know then, I might choose differently. The good news is that the reason for my possible change of heart don't apply to the vast majority of web sites. That's a fairly geeky topic covered in Why might you want to use "www" in your website references?.
By forcing people to land on the URL that you want, rather than whatever they typed in, any links they then create by copy/pasting out of the address bar (a common way to get the URL of a page), or any bookmarks that they save will use the style you selected.
By "forcing" I mean this: if you go to "http://www.ask-leo.com" the page you will eventually end up on, and the address that you'll see in your browsers address bar is http://ask-leo.com, without the www.
Even though you said www.
How'd I do that?
This is going to depend heavily on your web host, what technologies they use, and which features of that technology they've enabled for your use. I can only describe what I do; if you use different technology you'll need to do some more research. The good news is that I'm fairly certain the ability is available for most.
Ask Leo! runs on an Apache web server under a Linux distribution. Under Apache there's a feature known as "URL rewriting" that allows you to define a set of conditions and if those conditions are met the URL is "rewritten" to be something else that the visitor is then sent to. These instructions can be placed in the server configuration files, or if enabled they can be placed in a file named ".htaccess" in the root folder of your site.
Here are the instructions I use:
Without getting too involved in the details, those three lines essentially say:
Turn on the rewrite "engine", or in other words, enable URL rewriting
If the incoming request is not for the domain "ask-leo.com" ...
... rewrite the request to be for the domain "ask-leo.com".
If I'd wanted to force "www.ask-leo.com" instead, those lines would be:
Same idea: if the page being requested isn't on www.ask-leo.com then rewrite it to be on www.ask-leo.com.
As the owner of a website make sure to pick which of "www.yoursite.com" or "yoursite.com" you want to use, and use it consistently throughout your site and in all external promotion or links to your site. This will allow search engines to see your site consistently as a single site, and not two sites on two different domains.
And if you can, use rewriting to "force" visitors to land on your choice, regardless of which they actually typed in.
Comments on this entry are closed.
If you have a question, start by using the search box up at the top of the page - there's a very good chance that your question has already been answered on Ask Leo!.
If you don't find your answer, head out to http://askleo.com/ask to ask your question.