Skip to main content

How To Redirect All Pages To New Domain Using Htaccess File

Redirect All Pages To New Domain Htaccess 301 Redirect

You can redirect all pages of your old domain to new domain using Htaccess file by redirect rule. Here is the simple code which you have to add in old domain Htaccess file.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.OldDomain\.com$
RewriteRule ^/?$ "http\:\/\/NewDomain\.com\/" [R=301,L]
RedirectMatch permanent /.* http://NewDomain.com/

simply add the above code to your old domain Htaccess file and save it. Now all the pages of your old domain will redirect to new domain.

Comments