In this tutorial, you will learn how to add a simple redirect for your website! We will cover on how to do that using Hostinger control panel’s or cPanel’s implemented Redirects feature. It is important to learn how to do that if you wish for your website or a certain website’s path to redirect to another website or another website’s path. For example, in this tutorial, we will use a website with a domain name thomvtutorials.com and add a redirect for it so it would take us to google.com instead.
Table of Contents
Before you begin this guide you’ll need the following:
- Access to the control panel of your hosting account.
The process of setting up a redirect in Hostinger is really quick and easy. You will only need to know the URL which you wish to redirect and the new location that the visitor will reach.
To redirect your website, you will first need to navigate to the Redirects section under the Domains category of the control panel.
After that, you will see 2 section. The first one will be your website, in this case http://thomtutorials.com. The second one will need to specify the new location, for example https://google.com. Once all the details are filled, press the Create button to continue.
Congratulations, that’s all you need to know in order to redirect a website on Hostinger!
If your hosting platform uses cPanel, the process of adding a redirect to your website is really similar. There are only a few additioanl options, which will be reviewed in-depth in this tutorial.
Start off by logging into your cPanel and follow these simple steps:
- Find the search bar at the top of the screen of your cPanel, like it is presented in the following screenshot:
- Enter keyword “redirects” into the search bar and click on the Redirects link which appeared under the Domains section:
After clicking on the Redirects button, you will be taken to the main Redirects window:
You can also notice that at the bottom of the page, in the Current Redirects section, there should be no active redirects enabled for your website yet:
But we’ll get back on that a bit later.
So here in this main Redirects window, start off by choosing the following:
- Permanent – This option will notify the search engine and visitor’s browser that URL has changed permanently (got redirected to another one) and it should always be loaded from the new location as soon as entered in browser/search engine. In our case, we should choose this option.
- Temporary – It works by notifying browser/search engine that the URL has changed, but before redirecting a user to that URL, try loading the old one first. In simple words, this type basically tells our browser: “Hey, my phone number has changed temporarily to this one, but I’m not sure for how long, so if needed, try calling the old one first to see if it works. If not, you will be transferred to the new one automatically”.
- http://(www .)?:
- All Public Domains – If you leave this option, a redirect will apply for ALL of the domains that your cPanel account has.
- Your chosen domain name – This option is different for everyone (displays your current domains assigned to this cPanel account). It lets you choose a specific domain to which the redirect will be applied for. In our case, please use this option.
These two sub-steps are shown in this picture:
If you have done those two sub-steps successfully, we will now go on to the most advanced part of this tutorial where you will need to fill in the rest of the settings for this redirect to become active. Take a good look at the following picture, every setting and what you need to add there is explained below it (number on the picture represents number in the explanation):
- Here in this field, you must manually enter your website’s subfolder (a path) that you want to be redirected to another website (or another path). For example, in this tutorial, it is chosen as subfolder, so the full link that will be redirected later will be something like this: http://www.thomvtutorials.com/subfolder. You can leave this field blank if you simply wish to add a redirect on your main website (not a specific folder), so it would look like this: http://www.thomvtutorials.com.
- Now in the field Redirects to, you must enter a destination of this redirect. In the picture, you can see that http://google.com is entered. So considering the previous sub-step, and the information that is added according to the picture, after submitting this redirect, a website link http://www.thomvtutorials.com/subfolder (if you entered this in a browser) will redirect you to http://google.com.
IMPORTANT: Do not forget to add “http://” before the destination domain (link) as it is required before submitting the redirect. (You will be given a warning message if you do not do that.)
- In the section “www . redirection”, you must choose the behaviour of this redirect:
- Only redirect with www . – This option will make it that your redirect will ONLY work if you enter the link WITH “www .” in front of it. For example, in our case redirect will only work if we enter www.thomvtutorials.com/subfolder to the browser.
- Redirect with or without www . – This option simply combines the first and the third one, so your site will be redirected with or without “www .”.
- Do Not Redirect www . – This option works the opposite way to the first one. A website will be redirected ONLY if we enter the link WITHOUT “www .” in front of it. So for example, it will only work if we enter thomvtutorials.com/subfolder to the browser.
- The Wild Card Redirect section can be read about in the Note section of the page. Basically, if you pick this option, all files inside the folder which we are adding a redirect for will be redirected to files with the same name in the destination folder. For example, if Wild Card Redirect is enabled for homedomain.com/subfolder (which is set to redirect to destinationdomain.com) and if we enter homedomain.com/subfolder/picture1.png to our browser, it will take us to destinationdomain.com/subfolder/picture1.png instead.
- After double-checking through the previous steps and sub-steps and being sure that you have done everything correctly, you can click on Add button. This will submit the redirect you have set up and make it live.
Now that you have successfully submitted your first redirect, you can test it out right away! Enter the page, that you had set up to redirect, into your browser and see where it takes you. If it takes you to the destination link, then congratulations, your redirect works as intended! If it does not work, then you must check a few things:
- If your website is working at all. That could be done by following this tutorial.
- Completely clear your browser’s cache. It could be that your browser is still showing you an old cached content of your website when the redirect was not added yet.
- Try testing the redirect with a different browser.
- See if your website is pointing correctly to your hosting. Check for any warning messages using this Tool.
IMPORTANT: Correct nameservers or IP address for an A record can be obtained from your hosting provider.
If none of those checks worked and your redirect is still not functioning, try removing it completely and adding it from the start. In the below picture, you can see how the added redirect should look in the List of Current Redirects section:
The process of deleting a redirect is more or less the same on cPanel platforms.
In both cases, the Actions section will allow you to completely Delete remove the redirection.
IMPORTANT: The redirect will be permanently removed and it will be impossible to restore it.
In this tutorial, you have learned how to add a simple redirect to your website using Hostinger control panel’s and cPanel’s redirect feature. If something does not work right, you can remove the redirect and re-add it again until you get it right. Practice makes perfect, so feel free to test out all the available options of this feature. Good luck!