This article explains how to redirect a subdomain to another domain using .htaccess.
Follow the steps-
- Log in to Plesk.
- Select the subdomain.
- Click on the “File Manager” sub-option.
- Click on the “+” sign and click on the “Create File” option
- Enter the following content-
RewriteEngine On RewriteBase / RewriteRule ^(.*)$ http://www.test.com/$1 [L,R=301,NC]
(www.test.com is the domain to which the redirect is performed)
- Click on the “OK” button.
In this manner, you can redirect a subdomain to another domain using .htaccess.
Now that you’ve set up your redirect, it’s good to know how to remove it when needed. Check out this guide to remove redirection in cPanel!