How to setup Redirect old Domain to a New Domain in WordPress

How to setup Redirect from an old Domain to a New Domain in WordPress

How to setup Redirect old Domain to a New Domain in WordPress-: When you change domains it is important that you maintain the integrity of the old URLs so that anyone clicking on a link to a page on your old website will be redirected to the same page on your new domain. For example: Clicking on www.yourolddomain.com/company/profile.php would automatically redirect visitors to the same page on your new website www.yournewdomain.com/company/profile.php. In this post, I will explain how to Redirect from an old Domain to a New Domain in WordPress.

How to setup Redirect old Domain to a New Domain in WordPress:

301 redirect is a permanent redirect which passes between 90-99% of link equity (ranking power) to the redirected page. 301 refers to the HTTP status code for this type of redirect. In most instances, the 301 redirect is the best method for implementing redirects on a website. Add the following line of code to your .htaccess file. replace newsite.com with your new domain old site with your old domain. Add the following line of code to your htaccess file. If you are unable to locate your htaccess file Read my post How to locate htaccess file in WordPress.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(?:www\.)oldsite\.com$ [NC]
RewriteRule ^ http://newsite.com%{REQUEST_URI} [L,R=301]

Thanks for reading…“Pardon my grammar, English is not my native tongue.”

If you like my work, Please Share on Social Media! You can Follow WP knol on Facebook, Twitter, Pinterest and YouTube for latest updates. You may Subscribe to WP Knol Newsletter to get latest updates via Email. You May also Continue Reading my Recent Posts Which Might Interest You.

About Amar Patel 263 Articles
Hi, I am Amar Patel from India. Founder, Author and Administrator of wpknol.com. I am a Simple Average Man who Loves life and Love living life.Professionally I am a Mechanical Engineer. Apart from my Job, I Love to write the things around WordPress WordPress CMS.