How to Configure 301 and 302 Domain Redirects in cPanel

46 views
Short answer: Open cPanel Redirects, choose permanent (301) redirect type, specify source directory and target destination URL, and click 'Add' to divert visitor traffic seamlessly.

Configure permanent (301) and temporary (302) redirects, route non-www to www traffic, and create wildcard URL redirections in cPanel.

Before you start: Back up your site files and database and download the backup to your own computer. How to take a full backup

Quick reference

Tool Location cPanel > Domains > Redirects
301 Redirect Permanent (Transfers SEO rankings & backlink equity)
302 Redirect Temporary (Does not update search engine indexes)
Destination Format Must include protocol: https://destination.com

Steps

  1. Open Redirects Interface: In cPanel, scroll to the Domains section and click Redirects.
  2. Configure Redirect Parameters:
    • Type: Select Permanent (301) for permanent website moves or Temporary (302) for maintenance redirects.
    • https?://(www.)?: Select the domain name from the dropdown. Leave the slash field blank to redirect the entire domain, or enter a subfolder (e.g. old-blog).
    • Redirects to: Enter the full destination URL including protocol (e.g. https://newdomain.com).
  3. Configure www Redirection:
    • Only redirect with www.: Only redirects visitors typing www.domain.com.
    • Redirect with or without www.: (Recommended) Catches all visitors.
    • Do Not Redirect www.: Excludes www requests.
  4. Wildcard Redirect: Check this option if you want sub-pages to redirect to the matching path on the new domain (e.g. old.com/about → new.com/about).
  5. Save: Click Add. cPanel automatically inserts the appropriate RewriteRules into your .htaccess file.

Troubleshooting and tips

  • Redirect Loop (ERR_TOO_MANY_REDIRECTS): Avoid redirecting a domain to itself without changing protocol or host (e.g. redirecting example.com to example.com). Check for duplicate redirect rules in WordPress settings or CDN edges.
  • Browser Cache Trapping 301s: Browsers aggressively cache 301 permanent redirects. When testing, always use an Incognito/Private window with DevTools "Disable cache" checked.
Need more help? If you run into an error while following these steps, open a ticket with technical support and our team will look into it. Open a ticket
Was this article helpful?
No, I need more help
Didn't find your answer?
Under 3 minutes
Submit Support Ticket