Dodona gives you answers

How do I redirect a non www address to a www address?

leave a comment »

In my case, I built a Flash site with SWFAddress to allow deeplinking. The downside to this was the site didn’t work well if a user used a URL like instead of

If your site runs on an Apache server, you can use .htaccess to redirect all users visiting a URL (without the www) to a URL (with the www). This is the code you need:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^
RewriteRule (.*)$1 [R=301,L]

Put it in a file named .htaccess, upload it to the root directory of your website, and your good to go.


Written by lutsen

December 9, 2009 at 2:13 pm

Posted in Actionscript, Web

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: