Sunday, 13 January 2013

Redirect Naked URL with www using htaccess file

There is some times requirement to redirect naked URL to URL having “www”.

We have the solutions with our .htaccess file.

The following line of code will help us to achieve the purpose.

### re-direct to www
RewriteCond %{HTTP_HOST} ^
RewriteRule (.*)$1 [R=301,L]

No comments:

Post a Comment