Home > Web > .htaccess redirect domain.com to www.domain.com

.htaccess redirect domain.com to www.domain.com

October 28th, 2013 Leave a comment Go to comments

In the. htaccess file place the following two lines:

rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Instead “domain.com” set your domain

Categories: Web Tags: ,
  1. No comments yet.
  1. No trackbacks yet.