If you wish to redirect all the URLs from one site to another site’s URL, then go through the following rewrite rules in .htaccess files.

For Example …

You want to redirect your old blog site, http://www.abc.com/blog, to a new domain, http://www.xyz.com/blog. So you have to include the following rules in the old blog site’s .htaccess file, which means when someone accesses the URL http://www.abc.com/blog/anything, it will be redirected to http://www.xyz.com/anything.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^abc\com\blog
RewriteRule ^(.*)$ http://www.abc.com/blog$1 [R=301,L]
RewriteRule ^$ http://www.xyz.com/ [L]
RewriteRule (.*) http://www.xyz.com/$1 [L]
</IfModule>

Note: Replace “www.abc.com/blog” equal to your old blog URL and also replace “www.xyz.com” equal to your new blog URL.

Popular Posts You May Read

Explore more hosting insights, tips and industry updates.

8 Ways on How The Cloud Can Safeguard Your Future

8 Ways on How The Cloud Can Safeguard Your Future

Cloud has become a revolution for businesses. At an unparalleled rate, companies across industries are…

Secure-your-WordPress-site-from-plugin-vulnerabilities

How to Secure Your WordPress Site by Addressing Plugin Flaws

Are you looking to secure your WordPress site? You are in the right place. Nowadays,…

Is Cheap Hosting Worth It? The Real Pros and Cons

Cheap hosting attracts many people who are just starting a website or running a small…