Explanation of redirecting your website links URL redirection

It may happen that you write a title for an article or that you put a title and name for a specific product (if your site is commercial), then you discover that the title has an error, and you decide to change it. As you know, the title is often the same as what is written in the page’s link. Note that when you write an article and it is shared By visitors on social networking sites or any other sites, it is important when clicking on these links that the article is reached, otherwise your site becomes unreliable, due to giving broken links to visitors, and the link remains for a period of time in Google search until it is discovered that it is It is damaged and is being removed. So what is the solution to this problem that could delay your site’s ranking in Google and may lead to its unreliability? This article explains how to avoid this problem in an easy way by converting 301 in WordPress. 


What is redirection?

The process of redirection means transferring the address of a specific page to another page, and the most famous of these redirections is 301, which is one of the famous numbers set by the IANA , and this number means that it has been “moved permanently.” Therefore, any page you access and you will be transferred to Another link, this means that you have been redirected.

Common reasons that may lead to a 301 redirect

  • Transferring your site from one hosting to another
  • Moving from one domain to another
  • Moving the site from a subdomain to a main domain (subdomain such as example.wpar.net or wpar.net/example) 
  • Purchase an SSL certificate and thus switch to https instead of http
  • Convert an old page to a new page
  • Change links to some pages on your site
  •  Change the permalink from within WordPress
  • Delete a page permanently
  • Merge two sites into one site

What is the difference between 301 and 307 redirects

There is another redirect, which is 307, which indicates that the requested address (page URL) has been changed to another temporary site and will be returned after a while. As an example of one of the reasons for using a 307 redirect when doing maintenance on your website, links and the site can be moved to a temporary subdomain. Then return it after maintenance is completed.


Make a 301 conversion with one of the add-ons

You can make conversions manually through the Htaccess file, or if there are a large number of conversions, we advise you to rely on a ready-made plugin. In this case, we advise you to add Redirection or through the free version of Rank Math or the paid version of Yoast.

We will now explain the conversion process through the free Redirection add-on, by going to Add-ons << Add new from the sidebar.

Then type redirect in the search and when the add-on appears, click Install Now

Then activate the add-on

After activation is completed, the following screen will appear. Go to the Tools submenu and choose Redirection

The welcome screen appears, click start setup 

The second screen will appear, click continue setup

The third screen will appear, choose finish setup

The fourth and final screen will appear, click Finish

Now the steps for setting up the add-on have been completed and you can redirect from any link to another link as follows:

First, add a test link with whatever name you want, let it be as follows:
https://learnwordpressinarabic.com/2020/12/18/Example
(this is the old link that will be converted), where this link is called source

Then add the new link to which it will be transferred, for example
https://learnwordpressinarabic.com/2020/11/03/hello-world/
and this link is called target as in the following figure. Then press the Add Redirection button and the addition is completed.

The following figure shows what has been added to the directed links table

Now see when you put the link in the browser how the automatic conversion takes place


Make the transfer through cPanel

The second method is to modify the .htaccess file through your site’s cpanel control panel, but you need to be careful so as not to make incorrect modifications to your site.

But the method is easy. You will go to the cpanel control panel for your site, then go to the Files section and choose from the File Manager as follows:

The file manager will open as shown below. Select the file, then click the Edit button 

You will see a warning message stating that you must make a backup copy of the .htaccess file first before making any modifications (this procedure is recommended if you are a beginner), then edit the file by clicking Edit. 

Go to the end of the file and add the following code in the last line of the file

Redirect 301 /oldpage https://learnwordpressinarabic.com/2020/11/03/hello-world/

This code is understood simply as Redirect 301 (which expresses the type of conversion,
then /oldpage, which symbolizes the old page that will be converted. For example, if the page was www.example.com/oldpage, you would write the page ID only /oldpage,
then the page you want to convert to (put Full link).
Then after completion, save changes as shown in the figure

Now you can go to the front end of your site (which is visible to visitors) and try writing the old page. You will be automatically transferred to the new page. 

The conversion can also be done through the htaccess file, and this file can be accessed through the famous add-on SEO by yoast. Install the add-on, then go to the SEO submenu and choose tools as follows.

Now click on File Editor to access the .htaccess file

htaccess file will appear as follows

Go to the end of the file and add the same code in the last line of the file

Redirect 301 /oldpage https://learnwordpressinarabic.com/2020/11/03/hello-world/

The conversion process will be completed successfully

If you own the paid version of Yoast, the add-on provides an easy way to direct old, deleted, or updated links to new links in a simple and easy way, through the control panel, as explained in this video . The add-on also detects any link that you have deleted or modified and indicates to you that you must take a specific action by redirecting these links.

Also, there is a powerful tool for advanced users called REGEX where Yoast SEO Premium enables you to crehttps://www.youtube.com/watch?v=0ztAjrsSvy8ate bulk redirects. This means that you can redirect a group of old URLs that may contain a certain word to new addresses, as an example the link could contain the date the articles were created, let it be December. All pages with old links that contain the word December will be directed to new links with a new name.

Note: The REGEX tool is very dangerous and may destroy your site, so advanced users should not use it.

Some other conversions you might use

  • 301 and its meaning is permanently transferred
  • 302 means a temporary redirection
  • 307 means a temporary redirection
  • 410 means the content has been deleted
  • 451 means the content is not available for legal reasons

Important note: The difference between 302 and 307 redirection is that if you want the redirected links to appear in Google results, you use 302, but if you want them not to appear or be archived, use 307, and of course it is recommended to use 307 ( this video is to learn the difference )

In the end, you must pay great attention to the issue of redirection, especially in the event of the disappearance of any page from the site or a group of pages, or due to moving your site to a new site, so that the pages are indexed correctly and the indexing is transferred from the old pages to the new pages

Avatar photo
I am a young man who has been working in WordPress and e-marketing for 10 years. I would like to share my experience with you so that we can become professional in WordPress I will be happy to share the experience with you.