Redirecting a subdomain to an external URL in cPanel ensures visitors are automatically sent to a specific webpage outside your hosting account.
Follow these steps to set up the redirect:
Step 1: Log in to cPanel
- Open your web browser and navigate to your cPanel login page (e.g.,
https://yourdomain.com:2083
). - Enter your username and password, then click Log in.
Step 2: Access the Redirects Tool
- Scroll down to the Domains section in the cPanel dashboard.
- Click on Redirects.
Step 3: Configure the Redirect
- In the Add Redirect section:
- Type: Select the type of redirect:
- Permanent (301): Use this for permanent redirects, which are better for SEO.
- Temporary (302): Use this for temporary redirects.
- Choose the Subdomain: Select the subdomain you want to redirect from the dropdown menu (e.g.,
blog.example.com
). - Redirects to: Enter the external URL where you want the subdomain to redirect (e.g.,
https://externalwebsite.com
).
- Type: Select the type of redirect:
- Redirect With or Without www.:
- Choose whether the redirect applies to both
www
and non-www
versions of the subdomain.
- Choose whether the redirect applies to both
Step 4: Save the Redirect
- Click Add to save the redirect.
- The redirect will be added to the list of active redirects in the Current Redirects section.
Step 5: Test the Redirect
- Open your browser and visit the subdomain (e.g.,
http://blog.example.com
). - Ensure that it redirects to the specified external URL.
Optional: Remove or Edit the Redirect
- To modify or delete the redirect:
- Return to the Redirects page in cPanel.
- Scroll to the Current Redirects section.
- Locate the redirect for the subdomain and click Edit or Delete as needed.
Tips for Redirecting Subdomains
- Check DNS Settings: Ensure the subdomain's DNS record is correctly configured to point to your hosting account, so the redirect works.
- Use SEO-Friendly Redirects: For long-term redirects, use a 301 Permanent Redirect to maintain search engine rankings.
- Monitor Redirects: Test your redirect regularly to ensure it functions as intended.
By redirecting a subdomain to an external URL in cPanel, you can efficiently manage traffic and direct users to the desired destination.