Applicable to:
- Plesk for Linux
Question
How to redirect a subdomain to another domain?
Answer
Use one of the following solutions:
-
Go to Domains > subdomain.example.com > File Manager and create
.htaccess
file (or open an existing one) : -
Add the following content:
CONFIG_TEXT: RewriteEngine On RewriteBase /
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]Note: Here www.example.com is the domain to which the redirect is performed
-
Navigate to Domains > subdomain.example.com > Hosting Settings and click on the [change] button:
-
Change the Hosting type to Forwarding and set up the desired URL:
Note: Forwarding type does not support HTTPS: it cannot be served over HTTPS and will not be secured with a certificate.
-
Go to Domains > subdomain.example.com >Apache & nginx Settings > Additional nginx directives:
-
Add the following line into the field:
CONFIG_TEXT: return 301 http://www.example.com/
Note: Here www.example.com is the domain to which the redirect is performed
-
Click on OK button.
Comments
0 comments
Please sign in to leave a comment.