How to Redirect Domains in cPanel
How to Redirect Domains in cPanel
Domain redirects automatically send visitors from one URL to another. They’re essential when you change domain names, restructure your site, or consolidate multiple domains.
Types of Redirects
| Type | Code | Use Case |
|---|---|---|
| Permanent | 301 | Domain change, URL restructuring (transfers SEO value) |
| Temporary | 302 | Maintenance, A/B testing, seasonal promotions |
Method 1: cPanel Redirects Tool
- Log into cPanel.
- Navigate to Domains > Redirects.
- Configure the redirect:
- Type: Choose “Permanent (301)” or “Temporary (302)”.
- Domain: Select the source domain from the dropdown.
- Path (optional): Enter a specific path to redirect (e.g.,
/old-page). Leave blank to redirect the entire domain. - Redirects to: Enter the full destination URL (e.g.,
https://newdomain.com). - WWW Redirection: Choose whether to redirect with or without www, or both.
- Wild Card Redirect: Check this to redirect all pages under the path to the same destination.
- Click Add.
Method 2: .htaccess Redirects
For more control, add redirect rules directly to your .htaccess file.
Redirect entire domain to another:
RewriteEngine On
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]
Redirect a specific page:
Redirect 301 /old-page https://yourdomain.com/new-page
Redirect using pattern matching:
RewriteEngine On
RewriteRule ^blog/(.*)$ https://yourdomain.com/articles/$1 [R=301,L]
Redirect HTTP to HTTPS:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Redirect non-www to www:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
Managing Existing Redirects
In cPanel, go to Domains > Redirects to see all current redirects. You can:
- Edit a redirect’s destination or type
- Delete redirects that are no longer needed
Redirect Chains
Avoid creating redirect chains (A → B → C). Each hop adds latency and can confuse search engines. Always redirect directly to the final destination.
Bad: old.com → www.old.com → new.com
Good: old.com → new.com and www.old.com → new.com
SEO Considerations
- Use 301 redirects for permanent moves — they pass approximately 90–99% of link equity to the new URL.
- Avoid 302 redirects for permanent changes — search engines treat them as temporary and may keep indexing the old URL.
- Update internal links to point directly to the new URLs rather than relying solely on redirects.
- Submit updated sitemap to Google Search Console after restructuring.
Testing Redirects
- Use browser developer tools (F12 > Network tab) to see redirect responses.
- Use online tools like Redirect Checker (httpstatus.io) to verify redirect chains.
- Use
curl -Ivia SSH to check response headers:curl -I https://yourdomain.com/old-page
Troubleshooting
- Redirect loop: Conflicting rules in
.htaccessor CMS settings. Check for duplicate redirect rules. - Redirect not working: Clear browser cache, check
.htaccessplacement, ensuremod_rewriteis enabled. - Wrong destination: Verify the redirect URL includes the correct protocol (
https://).
For redirect assistance, contact 10Corp support.