Permanent redirect (301) with .htaccess




To set a permanent redirection from with example.com and www.example.com to example1.com, 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 example.com by replacing the domains as per your need and check the website..




Soji Jacob

Location : Bangalore

You may also like...