970_90

Tuesday, 3 March 2015

non-www Redirect to www htaccess

non-www Redirect to www htaccess

If you want to redirect http://example.com to http://www.example.com
Open your .htaccess file and add following code.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]



No comments:

Post a Comment