Domain redirect

Domain redirect

The domain has to be redirected from http://domain.com to http://www.domain.com to stop content duplication.
This has to be done by creating the .htaccess file in the root folder.

creating .htacces file is very simple.

Open a notepad or any text editor copy paste the following code


Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^yourdomain.com [nc]
rewriterule ^(.*)$ http://www.yourdomain.com/$1 [r=301,nc]

in that above code modify yourdomain then save the file as .htaccess without any filename

upload the .htaccess file in your root directory.

That is it. Your domain has redirected.

Print Friendly, PDF & Email

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.