Wednesday, 28 December 2016

htaccess redirect to non-www




Just paste the below code in your .htaccess file to redirect non-www to www URL
make sure that mod_rewrite module is enable in your server. 

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

No comments:

Post a Comment