Articles in this section

How to redirect a subdomain to another domain?

kb: how-to Plesk for Linux ABT: Group A

Applicable to:

  • Plesk for Linux

Question

How to redirect a subdomain to another domain?

Answer

Use one of the following solutions:

Redirect using .htaccess
  1. Log into Plesk

  2. Go to Domains > subdomain.example.com > File Manager and create .htaccess file (or open an existing one) :
    f1.PNG

  3. 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

Redirect using Plesk Forwarding hosting type
  1. Log into Plesk

  2. Navigate to Domains > subdomain.example.com > Hosting Settings and click on the [change] button:
    f2.PNG

  3. Change the Hosting type to Forwarding and set up the desired URL:

    f3.PNG

    Note: Forwarding type does not support HTTPS: it cannot be served over HTTPS and will not be secured with a certificate.

Redirect using additional directives
  1. Log into Plesk

  2. Go to Domains > subdomain.example.com >Apache & nginx Settings > Additional nginx directives:
    f4.PNG

  3. 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

  4. Click on OK button.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.