This article covers domain redirection using the .htaccess file on Webhosting. If you do not have Webhosting, follow the instructions in the article Domains – Basic Redirect.
In this article you will learn:
- How HTTPS redirection works
- How to set up redirection on Webhosting
- Common problems
- Frequently asked questions
Redirection with HTTPS
The following procedure uses the option to generate an SSL certificate for any domain or subdomain within the basic HTTPS setup on Webhosting or its alias.
The redirection itself is handled by the .htaccess file, which redirects the HTTPS request to the specified address.
Setting up redirection on Webhosting
Before setting up redirection on Webhosting, make sure that:
- The domain you want to redirect is set up as a name or Webhosting alias.
- The Webhosting directory structure uses rules for different alias websites (multihosting).
- The domain in DNS points to the hosting that is redirecting it. If you use WEDOS DNS, you can let it point automatically when setting up the alias; otherwise, you must set up DNS manually. You can find the IP addresses of the services according to the instructions DNS – A and AAAA record types.
- You are using the default .htaccess file on the given Webhosting. If not, follow the section Non-default .htaccess.
- If you want to redirect via HTTPS, also make sure that you have a Let’s Encrypt certificate activated on the Webhosting for the redirected domain according to the instructions Webhosting – Manual HTTPS setup.
Then follow these steps:
- Log in to the Webhosting FTP according to the instructions FTP – Login.
- Go to the www/domains folder.
- Create a new directory named after the domain you want to redirect.
- In this directory, create a new file named .htaccess (including the dot at the beginning).
- Insert the code into the newly created .htaccess file:
RewriteEngine On
RewriteRule (.*) https://novadomena.tld/ [R=301,L]
Replace the text novadomena.tld in the code with the address to which you want to redirect the domain. Then save the code.

If the conditions are met, redirection via Webhosting should work immediately after saving the .htaccess file. If not, test it in an incognito browser window.
Non-default .htaccess
This procedure may cause website errors on the original Webhosting domain.
If you do not use the default WEDOS .htaccess file in the www folder, insert this code at the beginning of the modified .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?staradomena\.tld$
RewriteRule (.*) https://novadomena.tld/$1 [R=301,L]
Adjust the second line of the code to the domain you are redirecting. Place the character \ before each dot in the domain name.
Adjust the third line of the code to the address to which you want to redirect the domain.
Common problems
Common redirection problems include:
TOO MANY REDIRECTS
Problem: Instead of the redirected website, the TOO MANY REDIRECTS error is displayed.
Cause: A loop occurred during redirection. It is most often caused by pointing the domain to itself.
Solution: Make sure the address you are redirecting to is different from the original domain.
If the problem persists, try extending the code to:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://novadomena.tld/$1 [R=301,L]
Frequently asked questions
What if I do not have Webhosting?
You can use domain redirection according to the instructions Domains – Basic Redirect, where HTTPS can be provided by the WEDOS Protection add-on service.
How do I set up redirection on the WebSite 1.0 service?
On the WebSite service, you can set up redirection by inserting custom JavaScript in the page settings. However, this solution may not behave correctly in all browsers.
If you use a paid WebSite plan and want to use the service only for HTTPS redirection to another domain, request the setup via form ⧉. Specify the WebSite service name and the target domain.