Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email

Magento Forum

Help your direct traffic get to your site! 
Jr. Member
Total Posts:  29
Joined:  2009-02-17
Yorkshire, England, Great Britain, United Kingdom

I had this idea over the weekend, I thought I would share it with you all.

Ask yourself, how many times have you gone to type a website in and missed a w off, or done an extra one!?
(ww.domain… wwww.domain...)

Everyone must have once or twice, then all you have to do is simply correct it.

But there is an easy fix to make sure this does not happen to your websites.

In your DNS settings for your domain, create the extra subdomains and IN CNAME.

Open your apache conf file, get to the Virtual Host with your domain in, and where you have.


Simply add two new lines with ServerAlias and ServerAlias
Restart Apache and test it out (you may need awhile (upto 48hours max) for to start working.

You should now see and load up your website. But we dont want this duplicate content due to the URL displaying different information.
Open your .htaccess file browse to the section that says “rewrite engine on”

Add the following code…

RewriteCond %{HTTP_HOST} ^domain\.co\.uk[NC,OR]
%{HTTP_HOST} ^ww\.domain\.co\.uk[NC,OR]
%{HTTP_HOST} ^wwww\.domain\.co\.uk[NC]
^(.*)$1 [L,R=301]

The first line will redirect to, and the 2nd and 3rd lines will move the ww. and wwww. to

Now when anyone makes this simply mistake they are automatically at your site.

This rewrite also helps anyone who types a link to a deep page wrong also.

i.e. if they type it will move it to the page automatically.

If you get alot of direct traffic you can go further and register for anyone who may miss the dot(.) out and then send them to
(Only worth doing when you receive alot of direct traffic)

Hope this helps.

Thanks for listening,


Magento Community Magento Community
Magento Community
Magento Community
Jr. Member
Total Posts:  1
Joined:  2009-05-19
WA state

google is pretty smart too about it.
If you type in a domain name without the www and without the .com , it will still work in the browser if the domain name is popular.

Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top