htaccess code for redirecting www to non-www

Issue :

Regardless of somebody accessing the site with or without the ‘www’ , it should always go to http://domain.com

Solution :

Use the following htaccess code :

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.domain.com
RewriteRule ^(.*) http://domain.com/$1 [R]

Filed Under: Quick fixesTechnical

Tags:

About the Author: InstaCarma is a provider of Enterprise Class Solutions for the Hosting Industry

RSSComments (0)

Trackback URL

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes
InstaCarma provides outsourced web hosting technical support, helpdesk management, datacenter automation, cloud service management. Sales - 1800 810 6547 - visit www.instacarma.com