06-14-2018, 10:27 AM
Redirect to www using htaccess redirect:
Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to <!-- w --><a class="postlink" href="http://www.domain.com">www.domain.com</a><!-- w -->
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ <!-- m --><a class="postlink" href="http://www.domain.com/$1">http://www.domain.com/$1</a><!-- m --> [r=301,nc]
Please REPLACE domain.com and <!-- w --><a class="postlink" href="http://www.newdomain.com">www.newdomain.com</a><!-- w --> with your actual domain name.
Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to <!-- w --><a class="postlink" href="http://www.domain.com">www.domain.com</a><!-- w -->
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ <!-- m --><a class="postlink" href="http://www.domain.com/$1">http://www.domain.com/$1</a><!-- m --> [r=301,nc]
Please REPLACE domain.com and <!-- w --><a class="postlink" href="http://www.newdomain.com">www.newdomain.com</a><!-- w --> with your actual domain name.