Redirecting w, ww, and wwww

Soldato
Joined
9 Mar 2010
Posts
2,841
It's something everyone has done before, even us developers will have inevitably done it before - mistype the number of W's.

Although not always required, as most domains will be setup to support or redirect with no prefix, when you do decide to type the "www" part sometimes you'll get it wrong.

For me, I hardly type the www when putting in a web address and as I've been using computers long enough when I do have to put it in I usually get it right. But this afternoon when I thought I'd have a quick jump on Facebook (don't judge) I accidentally put in "wwww.facebook.com".

To my surprise however I was redirected to www.facebook.com.

At first I thought it was something that was happening with Chrome but upon checking another site I wasn't redirected.

My next thought was that this is a bloody good idea! In fact, why not redirect "w" and "ww" as well as I bet they're both common mistakes!

Of course, turns out Facebook already do this (as do a few other sites e.g. w.google.com) but there are plenty that don't.

Obviously there's a balance of "is this and is it actually worth the effort - how many people type wwwwwwwwwwww?" but it makes sense to me.

A bit of digging reveals that Facebook redirect w, ww and wwww where as Google only redirect w and ww. Yahoo don't redirect w but do redirect ww and wwww.

For me I think on all my websites I'm going to redirect w, ww and wwww.

What are your thoughts? Worth the effort to help the simple minded few? :)
 
I can understand the advantage of adding either a redirect or even adding an A record for ww and wwww but not for anything else.

In my experience working mostly on a help-desk, the people who it would help, are those you tell to go to the following website blaah.com will almost all say "is that www.?" first, and then proceed to use 1 finger and hit the w key 3 times.

Yes it could help some. We have some corporate sites that will only work with the www. record inplace, and do not automatically redirect if you omit them, but it will only help those who do indeed mistype the www. which are often those who don't generally use them. Like yourself. (and I)
 
The way I handle that is to start by CNAME'ing *.example.org to example.org. The server that example.org points to is running IIS, under which I have a website handling all requests that aren't explicitly bound to a site. Any requests to this site are 301'd to example.org which is a separate site with only that host header bound.

If I need a sub-domain, such as forum.example.org, then I just need to bind that host header to an existing site in IIS or create a new site to suit.

Simples ;)

NB: If you need to do this for more than one site in IIS then AFAIK you need to use a separate IP address for your 'catch all' redirect.
 
Last edited:
If your using .Net. You could create a custom 404 page or http module that uses a regex rules based redirecting. You can specify certain domains, ignore certain domains, and then have a default catch all at the end, should no other rules match.

I was doing this way back in 2003, when I was developing a URL rewriter for our custom .net framework.

This can all be done just using the FTP to the site root. No need to use any cpanels or other host specific feature.
 
Last edited:
Back
Top Bottom