SEO Tips

How to implement 301 redirect: using WordPress redirection plugin, htaccess file or php code

You can implement “301 redirect” using several ways. I am sharing some simple and most widely used methods to create “301 redirect“.

301 redirect using WordPress Redirection Plugin

Redirection” is wordpress plugin which makes your “301 redirect” task simple and it doesn’t require knowledge of “.htaccess” file or PHP.

To use this plugin is very easy, you have to provide your old URL and New URL and it will create a “301 redirect” entry for you.

It not only creates the “301 redirect” but it takes care of all broken links as well.

301 redirect using .htaccess file

You must have access to your server .htaccess file or alternatively you can ask for access to your webhosting provider.

Moving a page
Redirect 301 /oldpage.html Redirect 301 /oldpage2.html

Moving a directory
redirect 301 /old-directory

Moving an entire site
redirect 301 /

301 redirect using PHP code

Moving a page in PHP
header(“Status: 301 Moved Permanently”, false, 301);

There other ways as well like ‘creating rule’ but they require advance level of PHP and htaccess file knowledge.