Learn cPanel

Controlling your Web Hosting Account has never been that easy thanks to cPanel web Control Panel!

• Last Updated: 01/18/2020
• ( 5 minutes reading )

How to manage Redirects in cPanel?

Introduction

The process of sending a visitor from one web address to another is considered as redirection. Technically, redirection occurs on the Web Server's level due to the fact the Web Server is responsible for receiving and answering the web request for a website. Therefore, for a redirection to be created, you will have to instruct the Web Server that whenever a certain domain or URL is accessed it will send the visitor to another one. This is usually achieved by editing a special file containing instructions for the Web Server called ".htaccess". That file is stored in the Document Root of each domain associated with your Web Hosting account and to edit it you will need special knowledge in the syntax of Web Server rules. Since not everyone is familiar with that syntax, cPanel introduces a feature that allows you to easily set up and manage redirects without writing a single line of code, and in the next lines of this tutorial, we are going to fully review the "Redirects" cPanel feature. 

 

Accessing the Redirects feature of cPanel

Before you can continue any further with this tutorial, you will need to access the cPanel service for your Web Hosting Account. To do that, please follow our tutorial "How to access cPanel". If you are already logged in or if you are aware of how to access cPanel, please continue with this guide. 

Once you are logged into the cPanel service, please look for the "Domains" features group. In it, you should find the "Redirects" feature. Once you see it, please click on it. 

 

Accessing the Redirects feature of cPanel

 

cPanel will then redirect you to a brand new page called "Redirects" where you will be able to manage all aspects of this feature. 

 

Add a new Redirect in cPanel

Let's begin by adding a new redirect. The first section you will see on the "Redirects" page is called "Add Redirect" and it is used to configure a single redirect. Of course, you can use it multiple times to add as many as redirects you would like to but please bear in mind that only one redirect per domain/URL will work. 

The available fields for configuration in this section are as follows. 

  • Type - Here you should choose the type of redirect. 
    • Permanent(301) -  This redirect will instruct the visitor's browser that this redirect is permanent, meaning that the browser will have to save it in its records.
    • Temporary(302) - This redirect is used when you would like to only temporarily redirect the visitor to a new domain/URL. Please note that the user browser WILL NOT remember this redirect. 
  • https?://(www.)? - Here, you should choose the domain name for which you will be adding this redirect. Please bear in mind that by default the value of "**All Public Domains**" will be selected. Leaving it like it is, will cause all domains you have added to your account to be redirected which is highly unlikely setup. 
  • / - This field is used when you would like to redirect a request to a file or folder. For example, if you would like to redirect domain.com/blog/ to blog.domain.com, then in this field you would type "blog/" since this is the URI that should be redirected. The same goes if you are redirecting a request to file. For example, if you would like to redirect a request from domain.com/blog.html to blog.domain.com you should type in this field "blog.html".
  • Redirects to - Here you will need to specify the complete URL to which you would like the visitor to be redirected. For example, if you would like to redirect a visitor from domain.com to newdomain.com in this field you would type "https://newdomain.com" or even the URI in case there is such "https://newdomain.com/blog/". Please bear in mind that you will have to enter the complete URL including the protocol and the URI if such.
  • www. redirection - Here you can specify whether or not the visitor will have to type www in front of the redirected domain name. 
  • Wild Card Redirect - If this option is selected, it will instruct the Web Server to redirect all requests made to a file or URI associated with the configured domain to the new location but with the same file or URI. For example, if you would like to redirect domain.com/blog.html to domain2.com/blog.html you should activate this option and no matter what file is requested from domain.com it will be redirected to the same file, however for domain2.com.

Finally, to add the configured redirection, please click on the "Add" button. 

 

Add new Redirect in cPanel

 

cPanel will then create the configured redirect and will show a status message of whether or not the redirect was created. Please go back to the "Redirects" page by clicking on the "Go Back" link respectively. 

 

Managing Current Redirects in cPanel

Now that you know how to add a new redirect, let's see what actions you can perform on the already existing redirects. The second section of the "Redirects" page is called "Current Redirects". In this section, you will be able to find a table containing all the configured redirects as rows of data. For each redirect, you will be provided with several columns with information. Let's review those. 

  • Domain - The actual domain name that has been redirected. 
  • Directory - In case the redirect is configured for a certain directory from the redirected domain.
  • Regular Expression - In case you have configured redirects using Regular Expression, cPanel will redirect all requests matching that Regular Expression.
  • Redirect URL - This is the URL TO which visitors will be redirected when accessing the redirected domain or URL.
  • HTTP Status Code - The HTTP Status Code of the redirection. 
  • Type - The type of redirection considering the Status code. As we have explained already cPanel supports only Permanent or Temporary redirections. 
  • Match www. - If you have configured the redirection to redirect visitors who have inserted the www prefix in front of the redirected domain name. 
  • Wildcard - Here you will see information related to whether or not wildcard redirection has been used. Explained above.
  • Action - The only available action you can take with redirection is to actually remove the redirection. Please note that redirections cannot be edited and in order to edit a redirection you will have to remove it and then add it once again. 

 

Deleting a redirection in cPanel

 

As you can see managing the redirections for your domain names is a pretty simple task, yet understanding how does the redirection actually works is often hard for non-technical users. Therefore, if you are not certain of how to configure redirection for your domains, please do not hesitate to contact our Technical Support Crew so they can assist you further with that endeavor. 

...
Sebahat
Content Marketing Specialist

Sebahat is a young and bright woman who has become an invaluable part of our team. She started as a Customer Care Representative, mastering that role and, along the way, growing into a tech-savvy individual who is well acquainted with every support layer of the company. Driven by her aim to improve our customers’ experience constantly, she is committed to enhancing the extraordinary support we deliver.