Domain Redirects: Setting Up 301 and 302 Redirects Correctly in cPanel
A domain redirect automatically sends visitors and search engines from one address to another. This is especially useful when content has moved, a new domain is being used or several domains should point to one common destination.
A redirect ensures that a requested URL automatically points to a different URL. Instead of visitors seeing an error message or landing on an outdated page, they are sent directly to the correct address.
In cPanel, redirects can be configured through the Redirects function in the Domains section. You can define whether an entire domain, a specific page or a directory should be redirected. You also decide whether the redirect should be permanent with the status code 301 or temporary with the status code 302.
A redirect is not the same as a DNS change. DNS determines which server a domain points to. A redirect only takes effect afterwards, once the request reaches the web server or website configuration.

What Is a Domain Redirect?
A domain redirect automatically sends visitors from a source address to a destination address. For example, if someone opens olddomain.ch, the web server can automatically redirect that request to newdomain.ch.
Redirects are used in many situations:
- A website has moved to a new domain.
- An old page has been replaced by a new URL.
- A typo domain or alternative spelling should lead to the main domain.
- The
wwwand non-wwwversions should be unified. - A short address should point to a longer landing page.
- A landing page or campaign should temporarily point to another destination.
Correctly configured redirects improve user guidance, prevent unnecessary error pages and can also be important for SEO.
301 or 302: Which Redirect Type Is Correct?
When creating a redirect in cPanel, the first step is to select the redirect type. This matters because it tells browsers and search engines whether the redirect is intended to be permanent or temporary.
Permanent 301
Meaning: The address has moved permanently.
Typical use: Domain changes, permanent URL changes, redirecting old pages to new pages.
SEO note: For long-term changes, 301 is usually the correct choice because search engines understand the new address as the permanent destination.
Temporary 302
Meaning: The address is only temporarily available at another location.
Typical use: Maintenance, temporary campaigns, short-term promotions or tests.
SEO note: Search engines generally continue to treat the original URL as the relevant address because the move is not signalled as permanent.
Rule of thumb
If a URL or domain has been replaced permanently, use 301. If the redirect should only apply for a short time, use 302. For most permanent website and domain migrations, 301 is the better choice.
Typical Practical Examples
1. Redirecting an old domain to a new domain
You moved your website from olddomain.ch to newdomain.ch. In this case, you would normally create a 301 redirect from the old domain to the new domain so visitors land directly on the new address.
2. Redirecting an old page to a new page
If a page URL has changed, for example from /offers.html to /services/offers, the old address should redirect to the matching new page. This is better than sending all old pages to the homepage.
3. Sending an alternative domain to the main domain
If you own several domains, such as a spelling variation, a hyphenated domain or an additional domain extension, you can redirect them to your preferred main domain.
4. Short-term redirect for maintenance or campaigns
If a page should only point to another destination for a short period of time, a 302 redirect may be appropriate. This applies, for example, to temporary promotions or maintenance pages.
Step by Step: Creating a Redirect in cPanel
- Log in to your cPanel account.
- In the Domains section, open the Redirects function.
- In the Type field, select either Permanent (301) or Temporary (302).
- In the domain dropdown, select the domain that should be redirected. Depending on your cPanel configuration, an option for all public domains may also be available.
- If only a specific path should be redirected, enter it in the path field, for example
old-directoryorold-page.html. - Enter the full destination address in the Redirects to field.
- Make sure the destination address begins with
http://orhttps://. - Select the desired www option.
- Enable Wild Card Redirect if required.
- Click Add to save the redirect.
- Test the redirect afterwards in a browser or through the current redirects overview.
The destination URL must be entered in full, for example https://www.newdomain.ch/. If the protocol https:// or http:// is missing, cPanel may not save or execute the redirect correctly.
Understanding the www Settings
When creating a redirect, cPanel offers several options for handling www. This setting determines whether only the address with www, only the address without www or both versions should be redirected.
| Option | Meaning | Recommendation |
|---|---|---|
| Only redirect with www | Only visitors to www.yourdomain.ch are redirected. |
Use only if the non-www version is intentionally handled differently. |
| Redirect with or without www | Both yourdomain.ch and www.yourdomain.ch are redirected. |
The most useful setting for most cases. |
| Do not redirect www | The www version is not redirected. |
Use only if there is a specific technical reason. |
Wild Card Redirect: Keeping the Subpage Structure
The Wild Card Redirect option is especially useful when not only the homepage but also subpages should redirect to the corresponding structure on the new domain.
Example without Wild Card Redirect:
olddomain.ch/contactredirects tonewdomain.cholddomain.ch/offersalso redirects tonewdomain.ch
Example with Wild Card Redirect:
olddomain.ch/contactredirects tonewdomain.ch/contactolddomain.ch/offersredirects tonewdomain.ch/offers
This function is helpful if the new domain has the same or a very similar page structure. If the page structure is different, important old URLs should be redirected individually to the most relevant new destination pages.
Redirect important old pages to the most relevant new pages whenever possible, not simply to the homepage. This is more helpful for visitors and usually cleaner from an SEO perspective.
HTTPS Redirect: Do Not Confuse It With Regular Redirects
If you want to automatically redirect visitors from http:// to https://, cPanel often provides the Force HTTPS Redirect option in the domain management interface. This option is specifically intended for redirecting to the secure HTTPS version.
Only enable HTTPS redirection if a valid SSL certificate exists for the domain. Otherwise, visitors may see a browser security warning.
Important for SSL
A domain redirect does not replace an SSL certificate. If a domain should be reachable via HTTPS, it needs a valid certificate — even if it redirects to another URL afterwards.
Changing or Deleting Existing Redirects
cPanel shows existing redirects in the current redirects overview. There, you can review or delete existing redirects. An existing redirect is usually not edited directly in cPanel. If you want to change the target, type or options, delete the existing redirect and then create it again with the new settings.
After every change, test whether the redirect works as expected. Ideally, use a private browser window or clear the browser cache, because browsers can cache redirects.
Redirects and .htaccess
When you create a redirect through cPanel, cPanel places the relevant rules in the .htaccess file. This file controls many web server rules for your website, including redirects, URL rewriting and, in some cases, application settings for systems such as WordPress.
If a redirect does not work as expected, there may already be other rules in the .htaccess file. WordPress, shop systems and other applications in particular may have their own rules that collide with or override cPanel redirects.
If a redirect does not work, check whether other redirect rules already exist in the .htaccess file. For WordPress, also check redirects in plugins, theme functions or website settings.
Common Domain Redirect Mistakes
1. Destination URL entered without https:// or http://
The destination address must be complete. Instead of www.newdomain.ch, use for example https://www.newdomain.ch/.
2. Creating a redirect loop
A redirect loop occurs when URL A redirects to URL B and URL B redirects back to URL A. The browser will usually report that too many redirects are happening.
3. Using 302 even though the change is permanent
For final domain or URL moves, a 301 redirect should usually be used. A 302 redirect only signals a temporary change.
4. Using Wild Card Redirect incorrectly
If the new website does not have the same page structure, a Wild Card Redirect may send visitors to non-existing subpages. Check the structure of the new website before enabling it.
5. Confusing DNS and redirects
A redirect only works if the domain technically reaches the web server where the redirect is configured. If the DNS records point to another server, the cPanel redirect may not apply.
Domain Redirect or Alias Domain?
An alias domain generally displays the same content as your main domain. A redirect, on the other hand, sends visitors to another URL. If you want visitors to always end up seeing your main domain in the address bar, a redirect is often the better solution.
Example: You own mycompany.com and want visitors to automatically land on https://www.mycompany.ch/. In that case, a 301 redirect may be the appropriate solution.
Frequently Asked Questions About 301 and 302 Redirects
Which redirect is better for SEO: 301 or 302?
For permanent changes, 301 is usually the better choice. 302 should be used only when the redirect is truly temporary.
Can I change a redirect later?
In cPanel, you usually delete an existing redirect and then recreate it with the new settings.
Why does my redirect not work immediately?
Possible causes include browser cache, existing .htaccess rules, WordPress plugins, an incorrect destination URL or DNS records that do not point to the relevant server.
Is a domain redirect the same as an email forwarder?
No. Domain redirects affect website visitors and URLs. Email forwarders are configured separately in cPanel under the Email section.
Does the old domain need to remain registered?
Yes. If an old domain should continue redirecting, it must remain registered and technically point to the server where the redirect is configured.
Register a New Domain
Domain redirects are especially useful if you own multiple domains, introduce a new main domain or want to protect alternative spellings. With CURIAWEB, you can check and register your desired domain directly online.