Mini Howto: redirect non www to www

Sometimes its needed for site functionality for the www to appear in the URL for some scripts and to just make the site cleaner and more consistent. You can do so with htaccess !

The these lines to your root .htaccess file:

RewriteEngine On
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^m3xs\.com$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

Make sure you save it as:

Also, TEST TEST TEST! Make sure you didn’t get a typo in your entry.

The above URL:
http;// will auto switch to

Note: Mod_rewrite will be executed before the 301 redirect statement. If you have any mod_rewrite rules this entry will need to be put above those.

– –