Redirects in cPanel: create, test, and remove
Create 301 and 302 redirects in cPanel, choose wildcard and www options, force HTTPS safely, test redirect behavior, and remove old rules without breaking .
On this page
Redirects send visitors and search engines from one URL to another. Use them when you rename a page, move a section of your site, retire an old domain, or need a temporary destination while maintenance is underway.
When to use redirects
- Move an old page such as
/old-page.htmlto a new URL. - Redirect an old domain to a new domain after a rebrand or .
- Temporarily send visitors to a maintenance page.
- Preserve search engine value after changing your URL structure.
cPanel creates redirect rules in the site's .htaccess file. If you already have custom rewrite rules, back up .htaccess before adding or removing redirects.
301 vs 302 redirects
| Type | HTTP code | When to use |
|---|---|---|
| Permanent | 301 | The old URL has permanently moved. Use this for page moves, domain changes, and most site s. |
| Temporary | 302 | The change is short-term. Use this for maintenance pages, temporary campaigns, or testing. |
Create a redirect in cPanel
- Log in to cPanel.
- Open Domains and choose Redirects.
- Select Permanent (301) or Temporary (302).
- Select the source domain.
- Leave the path blank to redirect the whole domain, or enter a specific path such as
old-page.html. - Enter the full destination URL, including
https://. - Choose the www and wildcard options that match your goal.
- Click Add.
cPanel writes the redirect as a rule in your .htaccess file automatically. The redirect is active immediately.
www and wildcard options
| Option | What it does | Typical use |
|---|---|---|
| Only redirect with www | Redirects www.example.com but not example.com. | Rare; use only when you deliberately split www and non-www behavior. |
| Redirect with or without www | Covers both example.com and www.example.com. | Best for most whole-domain redirects. |
| Wildcard redirect | Preserves the requested path when sending traffic to another domain. | Redirect /old/path to https://newdomain.com/old/path. |
Do not redirect a URL to another URL that redirects again if you can avoid it. Send visitors directly to the final destination to improve speed and reduce browser or cache confusion.
Force HTTPS
If AutoSSL is active for the domain, use cPanel's Domains interface and enable Force HTTPS Redirect when the toggle is available. This is usually cleaner than creating a manual HTTP to HTTPS redirect in the Redirects tool.
If your cPanel theme does not show that option, add a standard HTTPS rule to the top of the domain's .htaccess file:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Remove and test redirects
To remove a cPanel-created redirect, go back to Domains, open Redirects, find the redirect in the list, and click Delete. If the rule was edited manually in .htaccess, remove it from the file instead.
Test in a private browser window or with a redirect checker after clearing your browser cache. Browsers cache 301 redirects aggressively, so a redirect can appear to remain even after it has been removed.
Troubleshooting redirects
| Problem | What to check |
|---|---|
| Redirect loop | Look for conflicting WordPress, Cloudflare, SSL, or .htaccess rules. |
| Redirect does not work | Confirm the domain points to this cPanel account and that Apache is reading the correct document root. |
| Wrong page redirects | Check wildcard settings and whether a broader rule appears above a specific rule. |
| HTTPS redirect fails | Make sure AutoSSL has issued a valid certificate before forcing HTTPS. |
For more complex patterns, use .htaccess directly:
# Single URL redirect
Redirect 301 /old-page.html https://yourdomain.com/new-page/
# Wildcard redirect: all paths under /blog/ to /articles/
RedirectMatch 301 ^/blog/(.*) https://yourdomain.com/articles/$1
Related: Advanced .htaccess in cPanel: redirects, PHP settings, and access rules | How to create and manage addon domains in cPanel | SSL/TLS management in cPanel-install, check, and renew | Index files in cPanel: default homepage names and troubleshooting | How to point a domain to UnderHost hosting
Need cPanel hosting or licensing?
Use UnderHost cPanel hosting or add cPanel/WHM to a VPS or dedicated server for familiar website, email, DNS, and database management.





















