Redirecting a cPanel subdomain to an external URL

A subdomain redirect is useful when a hostname such as help.example.com should send visitors to a hosted help centre or another website. Use an HTTP redirect for a destination that includes a page path; DNS cannot redirect a browser to a path.

What you need before you begin

The source hostname must resolve to a server that can issue the redirect. HTTPS requests also require a valid certificate for that source hostname. Check the destination’s exact URL and decide whether it should receive the original path.

01 Redirect a cPanel subdomain to an external URL

  1. Open Redirects in cPanel and choose the subdomain from the source-domain list. Confirm that you have not selected the parent domain.
  2. Choose the required temporary or permanent redirect type. Enter the complete target URL with its scheme and path.
  3. Use Wild Card Redirect only when matching source paths should be preserved at the destination. For a fixed destination, leave path preservation off and verify which source URLs the generated rule matches. If every possible path must reach the same page, confirm that scope through the supported redirect configuration rather than assuming the checkbox alone implements it.
  4. Add the redirect, then test both the subdomain root and a made-up or representative internal path. Inspect the resulting destination rather than only the final page’s appearance.

Confirm the expected result

Check for a single sensible redirect chain and confirm the destination works on mobile as well as desktop. Test HTTPS directly, since a working HTTP redirect can hide a missing source certificate.

Why does the subdomain redirect loop or still open the local application?

If the subdomain still opens a local application, inspect the application’s own redirect rules and the order of .htaccess rules. If the destination sends visitors back to the source, remove the loop. Keep a record of the old rule so the change can be reversed cleanly.

Sources and further reading

  • 0 Users Found This Useful
  • cpanel-whm, domains-dns
Was this answer helpful?

Related Articles

Adding a domain alias that shares an existing cPanel website

A domain alias serves an existing website under an additional hostname. It is useful for a...

Removing a domain alias from cPanel

Removing an alias stops that hostname being configured as an additional entry to the website on...

Adding a separate website domain in cPanel

Add a separate website domain when another registered name should have its own files rather...

Removing a separate website domain from cPanel

Remove an additional hosted domain when its website is being retired or moved away. Removing...

Redirecting an additional cPanel domain to another website

Use a redirect when visitors to an additional domain should be sent to another URL. A redirect...