To redirect a subdomain to an external URL in Plesk, you can use URL forwarding (also known as a 301 redirect or 302 redirect) to point your subdomain to another website. This is useful if you want a subdomain like sub.example.com
to automatically redirect visitors to an external URL (e.g., http://external-site.com
).
Here’s how you can set up a subdomain redirect in Plesk:
Step-by-Step Guide to Redirect a Subdomain to an External URL in Plesk:
Step 1: Log in to Plesk
- Open your Plesk control panel by navigating to
https://your-domain.com:8443
(replaceyour-domain.com
with your actual domain or server IP address). - Enter your admin username and password to log in.
Step 2: Go to the "Websites & Domains" Section
- After logging in, click on the "Websites & Domains" tab from the Plesk dashboard.
- This section will show all your domains and subdomains.
Step 3: Select the Subdomain
- Find the main domain (e.g.,
example.com
) that contains the subdomain you want to redirect. - Locate the subdomain you want to redirect (e.g.,
sub.example.com
). - Click the "Manage" button (or three dots next to the subdomain).
Step 4: Set Up URL Redirect for the Subdomain
- Once you’re in the subdomain management page, look for the option to "Hosting Settings" or "Web Hosting Settings" (depending on your Plesk version).
- In the "Web Hosting Settings" section, choose the "Forwarding" option.
- This option allows you to forward the subdomain to another URL.
Step 5: Enter the External URL
- In the "Forwarding URL" field, enter the external URL where you want the subdomain to redirect (e.g.,
http://external-site.com
orhttps://external-site.com
). - Choose the forwarding type:
- 301 Permanent Redirect: This is used for SEO purposes and tells search engines that the redirection is permanent.
- 302 Temporary Redirect: This is used when the redirection is temporary, and search engines will keep the original URL in their index.
- Optionally, you can choose to enable "Redirect with or without www" depending on whether you want to redirect both versions of the subdomain (e.g.,
sub.example.com
andwww.sub.example.com
).
Step 6: Save the Changes
- Once you have entered the external URL and chosen the appropriate redirect type, click "OK" or "Apply" to save the changes.
- Plesk will now set up the redirect.
Step 7: Test the Redirection
- After setting up the redirect, give it a few moments to propagate.
- Open a browser and enter the subdomain URL (e.g.,
sub.example.com
).- You should be automatically redirected to the external URL you specified (e.g.,
http://external-site.com
).
- You should be automatically redirected to the external URL you specified (e.g.,
Additional Notes:
- DNS Settings: Make sure that the DNS A record for the subdomain points to the correct server, even if you're using URL forwarding. You don't need to change this if you're only setting up a redirection in Plesk.
- SEO Considerations: If you use a 301 Permanent Redirect, search engines will consider the subdomain to have moved permanently to the new URL. Use 302 if you want search engines to treat the redirection as temporary.
- HTTPS Redirect: If you are redirecting to an HTTPS URL, ensure that you have an SSL certificate installed for the subdomain if needed.
By following these steps, you can easily set up a subdomain redirect to an external URL in Plesk.