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 exaple.com instead of www.example.com.

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

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$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.

Link:
www.stepforth.com/resources/web-marketing-knowledgebase/non-www-redirect

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:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: