1. Home
  2. Domains & DNS
  3. How do I create a redirect?

How do I create a redirect?

If you are looking for how to set up email forwarders, see this guide.

To create a redirect you need to log on to cPanel, we have a guide here that shows you how to do that. Then follow the steps below to create a redirect.

  1. Click the icon Redirects under Domains.
  2. You will now see the following:
  3. Under Type, you need to choose what kind of redirect it should be. The most common is 301 which is a permanent redirect, this means that you don’t plan to remove the redirect in a while. If you are only going to use the redirect for a short while, you can choose 302 temporary.
  4. In the next field, you need to choose which domain you want to redirect from. In our example, we have chosen oderland-demo.se.

If you can’t find the domain you want to redirect from in the list, you need to add it to your web hosting account first.

  1. In the field below it, select whether it is a subpage of the domain you just selected that should be redirected. For example, if you want oderland-demo.se/test to be redirected, type test in that field. If you only want test.se to be redirected, leave that field blank, as in this case.
  2. In the Redirect to field, enter the URL you want the redirection to go to. You must enter http:// or https:// at the beginning, in this example we enter https://my-redirect-target.com.
  3. Under www. redirection, select whether you want the redirection to redirect with www, only without www or both with and without.
  4. Finally, you can tick whether or not you want to redirect with wildcards. This means that if you go to the address oderland-demo.se/test, for example, you will be redirected to my-redirect-target.com/test. This means that if you redirect with wildcards, you will be redirected to the same subpage on the receiving domain.
  5. Click Add when you’re done.

The redirection rules are added to the .htaccess file located in the root of the domain you choose to redirect from. If there is already code in the .htaccess file, the redirect code will be added at the end of the file. Therefore, if the redirect does not work for you, you may need to manually edit the .htaccess file and move the redirect code to the top. You can use cPanel’s File Manager to edit the file.

Was this article helpful?

Related Articles