3 min read Sep 26, 2026

How to Set Up Redirects, Custom Error Pages and .htaccess Rules in cPanel

Redirect pages or whole domains with cPanel Redirects, choose 301 or 302, redirect www to non-www, create custom 404 pages and add safe .htaccess rules on cPanel Hosting.

FimuroHost Team

FimuroHost Team

Technical Writer

Share Article

Redirects send visitors (and search engines) from one address to another, for example from an old page to a new one, or from an old domain to your new domain. cPanel has a Redirects tool that writes the rules for you, and you can also add rules yourself in the .htaccess file, which the web server reads for every request.

301 or 302?

TypeUse it when
Permanent (301)The page or site has moved for good. Search engines transfer rankings to the new address. Use this in almost all cases.
Temporary (302)The move is short-term, such as a maintenance page or seasonal campaign.

Create a redirect with the Redirects tool

  1. Log in to your FimuroHost client area at https://app.fimurohost.com.
  2. Go to Services and select your cPanel Hosting plan.
  3. Click Login to cPanel. cPanel opens in a new tab, already signed in.
  4. In the Domains section, click Redirects.
  5. Type: choose Permanent (301) or Temporary (302).
  6. https?://(www.)?: choose the domain to redirect from, or ** All Public Domains **.
  7. In the / box, enter the path to redirect, for example old-page.html or offers. Leave it empty to redirect the whole domain.
  8. Redirects to: the full destination URL including https://, for example https://yourdomain.com/new-page/.
  9. www. redirection: choose Redirect with or without www. in most cases.
  10. Tick Wild Card Redirect if every file in the old folder should go to the same file name in the new location (for example moving a whole domain page by page).
  11. Click Add.

The rules are added to the bottom of the .htaccess file in the domain’s document root. Existing redirects cannot be edited; delete and re-add them in the Current Redirects table. Test in a private browser window, because browsers cache 301 redirects.

Useful .htaccess rules

Open File Manager, turn on Show Hidden Files, and edit .htaccess in your document root. Download a copy first: one typing mistake causes a 500 Internal Server Error for the whole site, and restoring the copy fixes it.

Redirect www to non-www (with HTTPS)

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com$ [NC]
RewriteRule ^(.*)$ https://yourdomain.com/$1 [L,R=301]

Redirect an old domain to a new one, keeping paths

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?old-domain\.com$ [NC]
RewriteRule ^(.*)$ https://new-domain.com/$1 [L,R=301]

Redirect a single page

Redirect 301 /about-us.html https://yourdomain.com/about/

For WordPress sites, put your own rules above the # BEGIN WordPress block and never edit inside it; WordPress rewrites that block.

To force HTTPS, use the Force HTTPS Redirect switch in Domains » Domains instead of writing your own rule (see our SSL guide).

Custom error pages

A friendly 404 (page not found) page keeps visitors on your site. Create a page such as 404.html in your document root, then add this line to .htaccess:

ErrorDocument 404 /404.html

You can do the same for 403 (forbidden) and 500 (server error). If your cPanel shows an Error Pages tool in the Advanced section, you can also create these pages there with a simple editor. WordPress and most other CMSs handle their own 404 pages, so you rarely need this for them.

Common problems

  • “Too many redirects” (redirect loop): two rules are sending visitors back and forth, often a redirect plus a WordPress or Cloudflare HTTPS setting. Remove your newest rule, then add rules one at a time.
  • 500 error after editing .htaccess: restore your copy, then check for typing mistakes.
  • Redirect does nothing: another rule higher in .htaccess may run first. Move your rule towards the top (below RewriteEngine On).

Need help?

If anything in this guide does not match what you see, or you get stuck, open a support ticket (choose the Support department) or message us on WhatsApp at 01818160926. Tell us your domain name and what you have tried so far, and never send your password in a ticket or chat.

FimuroHost Team

Written by

FimuroHost Team

Technical Writer