Permanent redirect (301) with .htaccess

To set a permanent redirection from with and to, the following code shall help you

RewriteEngine on

RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^(.*)$ “http\:\/\/example1\.com\/$1″ [R=301,L]

Just put the above code in the .htaccess file  under by replacing the domains as per your need and check the website..

Soji Jacob

Location : Bangalore

You may also like...