Forum Topic: redirecting wwww to www

Forum: .htaccess Forum : Redirecting • Posted by Dave Austin • Updated:

Recently it become apparent that I need to redirect to www when user input wwww, ww and w by mistake. I am sure i should be able to do the with .htacess but not having much luck.

Because of the way my server is set up everytime someone uses a wrong combination of the w's they get redirected to the first site in my domains folder which houses all my sites.

So for example if I have two domain in the domains folder, and and the user enters they arrive at, I want them to arrive at

Am I right in think I can do this with .htaccess, the server is ubuntu linux

If this can be dne could you give me an example please



2 Replies to “redirecting wwww to www”

Jeff Starr
Posted by Jeff Starr

Yes as long as .htaccess is enabled on the server, it should work fine. Please see chapter 5.1 in the book for www and no-www techniques.

Posted by Dave Austin •

Thanks Jeff I will take a look at this in the book