Permanent redirect (301) with .htaccess

Estimated read time 1 min read

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..

You May Also Like

More From Author