How do I set up a domain or subdomain redirect to another address?

It happens that for some reason there is a need to set up redirects. Most often this is due to a change of address and thus the desire to transfer the earned power of the old domain (it is about search engines and positions in their search results).

You can set up redirection in two ways:

Setting up redirection in the hosting account panel

This is the least cumbersome change for beginners. Follow the steps below:

Step 1: Log in to your hosting account panel

Step 2: On the main panel page, click on the "Hosting and DNS" tab and then on the "Hosting Settings" link.

Remember to perform these steps for the specific domain you want to redirect.

Hosting account panel and transition to settings

Step 3: On the next page, next to the "Hosting type" option, click on the "Change" link

Here you click on the link Change

The page will reload and you can select "Redirect" from the list. Below that, you enter the URL that you want the domain to direct traffic to, and even below that, you can select the type of redirect. You can choose between 301 (selected by default), 302 and frame redirection.

Domain redirection configuration form

301 redirect is used most frequently. It is this type of redirection that allows you to inform the search engine that the website address has simply changed. Thanks to this, the power of the old domain mentioned at the beginning will be transferred to the new one.

302 redirection is a temporary redirect. Use in situations where the redirection will not be permanent, e.g. you want to direct traffic to a different address for 1 day, but after that you go back to the previous order. Do not use this type of redirect for too long.

Frame redirection allows you to keep the old domain in the browser address bar, while inside the browser window the content of the page to which you redirect the domain will load in a frame (invisible to the eye). Someone who goes to the old address will not know that the page is actually loading from a different address 🙂

Use frame redirection only in specific situations. It is not a type of redirect that would have a positive impact on SEO.

Once you have decided what type of redirect to use, click on the "OK" button and the redirect takes effect 🙂

Setting redirection in .htaccess file

When you opt for this form of redirection, you will be able to decide on many additional rules. A separate article on this subject will appear on How to Make a Websiteand here a simple rule to be inserted in the file. But let's start with where you will find the file named .htaccess

Go to the root directory of the domain, this is the directory where all the site files and folders are located. In the case of the main account domain, the directory is called "httpdocs". In it, look for the .htaccess file

location of the .htaccess file in the file manager of the hosting account

If it turns out that the file is not there, create it. For WordPress, simply change the way addresses are built in its direct links settings. 'Entry name' is the most common choice, but you can set any other scheme you like depending on your needs. Then save the changes, go back to the file manager and you should see the .htaccess file.

If you necessarily want to use the default form of URLs WordPress or the site is not WordPress, add the .htaccess file in the file manager.

Don't forget the dot at the beginning of the name! It is crucial 🙂

Open this file and insert the following example code into it, the purpose of which is to create a 301 redirect. Remember to replace the addresses in the example below with your domains.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)? [NC].
RewriteRule (.*)$1 [R=301,L]

Save the changes and check that the redirection works correctly.

Toggle Dark Mode Toggle Dark Mode
Toggle Large Font Size Toggle Font Size