How to redirect a page or website in cPanel
Help centreOn this page
This guide shows how to send visitors from one address to another. You can move a single page, point a whole domain at a different site, or tidy up old links after a redesign, using the Redirects tool in cPanel or a few lines in .htaccess.
301 or 302
cPanel asks you to pick a type before it creates anything.
- Permanent (301). Use this when the old address is gone for good. Search engines move the old page’s ranking across to the new one, and browsers remember the jump.
- Temporary (302). Use this for short spells, such as sending people to a holding page during a sale or while a section is rebuilt. Search engines keep the old address listed.
If you aren’t sure, a 301 is right for most moves. Browsers cache a 301 hard, so test in a private window and get it right before you share links.
Redirect a single page
- Log in to cPanel.
- In the Domains section, open Redirects.
- Set Type to Permanent (301) or Temporary (302).
- In the https?://(www.)? dropdown, pick the domain the old page lives on.
- In the box after the slash, type the old path, for example
old-prices.htmlorservices/old-page. - In Redirects to, type the full new address, for example
https://yourdomain.co.uk/prices/. - Leave www. redirection on Redirect with or without www. unless you have a reason to change it.
- Leave Wild Card Redirect unticked for a single page.
- Click Add.
Open the old address in a private browser window to check it lands on the new page.
Redirect a whole domain to another site
Use this when you have an old domain, or a spare one, and want every visitor to end up on your main site.
- In cPanel, open Redirects.
- Choose Permanent (301).
- Pick the old domain from the dropdown and leave the path box empty.
- In Redirects to, type the address of the main site, such as
https://yourdomain.co.uk/. - Tick Wild Card Redirect if you want
olddomain.co.uk/contactto go toyourdomain.co.uk/contact. Leave it unticked to send every old page to the home page. - Click Add.
The old domain must already be on your hosting as an addon or alias, and its DNS must point at our servers. See how to add another domain to your hosting.
The www option
The www. redirection setting has three choices:
- Only redirect with www. catches
www.yourdomain.co.ukonly. - Redirect with or without www. catches both. This is the usual choice.
- Do Not Redirect www. catches the bare domain only.
If you want to make your site always use www, or never use it, do that with a single rule in .htaccess rather than lots of redirects.
Remove a redirect
Under Current Redirects lower down the Redirects page, click Delete next to the one you no longer want. Clear your browser cache afterwards, because a 301 can stick around in the browser even after it’s removed from the server.
Using .htaccess instead
The Redirects tool writes rules into .htaccess for you. You can also add them by hand, which is handy for lots of pages at once.
- Open File Manager and go to
public_html. - Under Settings, make sure hidden files are shown (the Show Hidden Files option).
- Right click
.htaccessand choose Copy to make a spare copy first. - Edit
.htaccessand add lines near the top, one per page:
Redirect 301 /old-page.html https://yourdomain.co.uk/new-page/
Redirect 301 /shop/winter-coats https://yourdomain.co.uk/shop/coats/
- Save and test each old address.
The first part is the old path, starting with a slash and without the domain. The second is the full new address.
WordPress sites
On WordPress, a redirect plugin is often easier than either method above. It lets you manage redirects from the dashboard, and many also log 404 errors so you can see which old links people still use. Pick a well reviewed plugin and keep it updated. Don’t run a plugin and cPanel redirects for the same page, or you may get a loop.
If it doesn’t work
- The browser says “too many redirects”. Two rules disagree. See how to fix too many redirects.
- The old page still shows. Your browser has cached it. Try a private window or a different device.
- You get a 404 on the new address. Check the spelling of the target, including the trailing slash.
- The whole site breaks after editing .htaccess. Put back the copy you made. A 500 error usually means a typo in the file. See what website error codes mean.
Related guides
Still stuck? Open a support ticket and we’ll help.
Every plan has cPanel, free SSL, backups every six hours and free migration.