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 domain or website 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 when the user queries information from it on their browser.

Therefore, for a redirection to be created, you will have to instruct the Web Server that whenever a specific domain or URL is accessed it will need to send the visitor to another address/URL. This is usually achieved by editing a hidden 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 of 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. In the next few lines of this tutorial, we will 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. Under it, you should find the "Redirects" feature. Once you see it, please click on it. 

 

redirects-functionality

 

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 - Please use this drop down menu to choose the type of redirect you want to configure for your domain name. 
    • 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.)? - Please use this drop down menu to select 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 a highly unlikely setup. 
  • / - Please use this text field to type in the URL or folder would like to redirect a request to. 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 a 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 - Please use this text filed to type in the complete URL to where 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 - Please use the radio button here to specify whether or not the visitor will have to type www in front of the redirected domain name. 
  • Wild Card Redirect - Please put a ticket inside this check box here If you want to 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, please click on the "Add" button to add the configured redirection

 

redirect-configuration

 

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 - Under this column, you will see the actual domain name that has been redirected. 
  • Directory - Under this column (if populated), you will see if the redirection is configured to redirect to a certain directory from the redirected domain.
  • Regular Expression - Under this column, you will see if you have used Regular Expression to set up the redirect, and cPanel will redirect all requests matching that Regular Expression.
  • Redirect URL - Under this column, you will see the URL TO which visitors will be redirected when accessing the redirected domain or URL.
  • HTTP Status Code - Under this column, you will see the HTTP Status Code of the redirection. 
  • Type - Under this column you will see the type of redirection considering the Status code. As we have explained already cPanel supports only Permanent or Temporary redirections. 
  • Match www. - Under this column, you will see If you have configured the redirection to redirect visitors who have inserted the www prefix in front of the redirected domain name. 
  • Wildcard - Under this column, you will see information related to whether or not wildcard redirection has been used. Explained above.
  • Action - Under this column, you will see the "Delete" action option. You can use it to actually remove the domain 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. 

 

delete-redirect

 

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. 

...
Nikola Zgurev
Technical Support Captain

Nikola is an accomplished tech-savvy extraordinaire with over six years of experience in the web hosting field. He started as a customer care representative and quickly rose the ranks to become a support supervisor and, eventually - the head of the technical department in HostArmada. His deep understanding of the client's needs, combined with his technical knowledge, makes him the perfect man to create the ideal harmony between client satisfaction and professional problem-solving. You will often find him creating helpful tutorials, articles, and blog posts that help existing customers get around.