How To Apply Permanent 301 Redirection .htaccess Code In WordPress (Step By Step)

This article helps you how to Apply Permanent 301 Redirection htaccess wordpress step by step.

What Is 301 Redirect :

301 redirect is a server side redirect and is a permanent redirect. A permanent 301 redirect in your .htaccess file lets search engines and others know that an old link has been replaced by a new one.

A permanent 301 redirect, which refers to the http status code, tells the search engines that the original URL has now moved or updated to a new URL.

Common uses of a 301 .htaccess redirect:

  • After a move to a new domain, use a 301 redirect on the old domain to send visitors to the new site.
  • An old file has moved locations, or the information is now contained in a new file.
  • After moving old site pages to a new site structure, use 301 redirects to send users to the new pages.
  • After combining two sites, use 301 redirects to ensure visitors go to the new pages.

301 Redirect .htaccess Code Example:

=> Place this code in .htaccess file

<IfModule mod_rewrite.c>

RewriteEngine On

Redirect 301 /how-to-speed-up-your-wordpress-website/ /how-to-bulk-product-upload-via-csv-in-wordpress/                                                      Like: Redirect 301 /oldurl/ /newurl/

</IfModule>

 

Single Url Redirect :

This is the cleanest way to redirect a URL. Quick, easy, and search-engine friendly.

Redirect 301 /old-page http://www.mydomain.com/new-page

Entire Domain Redirect:

Redirect 301 / http://www.newdomain.com/

How to implement a .htaccess file using the cPanel File Manager

The cPanel File Manager provides an easy way to create or access a .htaccess file. Here’s how:

  1. Go to your cPanel.
  2. In the Files section of the cPanel, click On File Manager.

  1. The File Manager opens in a new tab. Click on the Settings button at the top right.
  2. In the Preferences window, check the Show Hidden Files checkbox. Click the Save button.

  1. The File Manager window now shows all files, including hidden ones. In the Filespanel, double-click the public_html item.
  2. The contents of the public_html folder now display. This is where your .htaccess file will live. For a new site, there isn’t a .htaccess file yet, so you’ll need to create it.
  3. Click the +File button at the top left.
  4. In the New File window, enter the filename as .htaccess and click Create New File.

  1. The .htaccess file appears in the list.

  1. In the Text Editor dialogue box, scroll down and make sure utf-8 is selected. Then click the Edit button.

  1. Click once on the .htaccess file to select it, then click Edit. And paste redirection code.

  1. When you’re done editing the .htaccess file, click the Save Changes button at the top right of the Text Editor window.

  1. You can now close the Text Editor tab. Now test your redirection is working. 

Thank for Reading my article, Hope you like this if any problem or query regarding this article please drop you query on my mail:- infosolutionindia94@gmail.com

Er. Raju Kaushik

 

Leave a Reply

Your email address will not be published. Required fields are marked *