How to set up a 301 redirect in cPanel

Category: cPanel

cPanel Redirects lets you send visitors from an old URL to a new one without manually editing .htaccess. Use it when you changed a page path, moved content to another domain, or need to prevent 404 errors after an update.

To force HTTP to HTTPS across the whole domain, Force HTTPS Redirect from Domains is usually the better option. Use Redirects when you need to move a specific URL, folder, or domain to another destination.

Before you start

  • Have access to the cPanel account where the source domain is added.
  • Decide whether the change is permanent 301 or temporary 302.
  • Keep the full destination URL ready, including https:// or http://.
  • Confirm whether you want to redirect only one path or the whole domain.

Choose the redirect type

  1. Log in to cPanel.
  2. Open the Domains section.
  3. Click Redirects.
  4. Under Type, choose Permanent (301) if the URL has changed permanently.
  5. Choose Temporary (302) if the change is provisional and you plan to bring the old URL back.

A 301 redirect tells browsers and search engines that the URL moved permanently. Do not use it for short tests if you are not sure about the final destination yet.

Configure the source and destination URL

  1. Under https?://(www.)?, select the domain that will receive the initial visit.
  2. If you only need to redirect one page or folder, type the path in the path field, for example old-page or blog/old.
  3. Under Redirects to, type the full destination URL, for example https://www.example.com/new-page.
  4. Check that there are no spaces, quotes, or double protocols such as https://https://.

If you leave the source path empty, cPanel may apply the redirect to the entire domain. Use that only when you really want to move the whole domain.

Review the www and wildcard options

  1. Use the www redirection option based on how you want visits to arrive: only with www, with and without www, or without redirecting www.
  2. Enable Wild Card Redirect only if every path should keep its equivalent on the destination.
  3. Leave it disabled if an old folder should point to one specific new page.
  4. Click Add to save the redirect.

Wildcard redirects can send many paths to the new destination. Before enabling one, confirm that it will not break pages that still need to open on the source domain.

Verify that the redirect works

  • Open a private browser window and enter the exact source URL.
  • Confirm that the browser reaches the correct destination URL.
  • Test the www and non-www variants if you configured that option.
  • If you use CMS cache, a CDN, or browser cache, clear it before deciding that the redirect failed.

You can also review the HTTP code with an external tool or with curl -I https://yourdomain.com/old-page if you have terminal access. You should see a 301 or 302 before the final URL.

Common errors

  • The URL does not change in the browser: the source domain or path does not match the real visit; check whether you used www, a different folder, or a cached URL.
  • A redirect loop appears: the source and destination point to each other, or the destination returns to the same URL; delete the duplicate rule and test again.
  • Every page goes to the same destination: wildcard was enabled or the path was left empty when you only wanted to move one page; recreate the rule with the exact path.

Still need help?

If this guide didn’t solve your issue, our team can help you via ticket.