Redirect Fixes in Plesk and cPanel
Hosting control panels make redirects easy to switch on, which is exactly why panel-hosted sites
so often end up with the same redirect in three places. A tick box in the panel forces HTTPS, another
picks www, a domain alias redirects, a line in .htaccess does the same job, and WordPress
adds its own on top.
The result is a chain of hops or a loop that nobody can trace because each setting lives on a different screen. This guide maps where Plesk and cPanel keep redirect settings, how they are layered, which one runs first, and how to reduce them to one clean set.
How a panel-hosted site is layered
On a typical Plesk server, a request passes through several pieces of software before your page is built, and each can send a redirect:
- nginx at the front. Plesk normally runs nginx as the public-facing server. Anything in the domain's Additional nginx directives box runs here, before Apache sees the request.
- Apache behind it. When the domain's proxy mode is on, nginx passes dynamic requests
to Apache. Apache reads its own configuration, anything in the Additional Apache directives
boxes, and then
.htaccessfiles. - PHP and the application. WordPress, a shop or a framework then decides whether the URL it was given is its preferred form, and may redirect again.
Panel settings such as the preferred domain and the HTTPS redirect are written by Plesk into the web server configuration it generates for the domain, so they sit in the first two layers even though you set them on a hosting settings screen.
cPanel servers are usually simpler: Apache is the main web server, sometimes with nginx added as a
caching proxy, and most redirect features in the cPanel interface work by writing rules into the domain's
.htaccess file. That makes cPanel redirects easy to inspect, and also easy to duplicate
by accident when someone later pastes their own rules into the same file.
.htaccess files are ignored. Redirect rules copied
from an Apache tutorial into .htaccess will then do nothing at all, which is a common reason
for "my redirect is not working".Where Plesk keeps redirect settings
Menu names vary between Plesk versions and themes, so treat these as landmarks rather than exact paths. All of them are reached from the domain in Websites & Domains.
| Setting | What it does | What to watch for |
|---|---|---|
| Preferred domain (in the domain's hosting settings) | Chooses www or non-www and sends the other with a permanent redirect Plesk describes as SEO-safe. | Duplicated by a www rule in
.htaccess, in the nginx box, in WordPress or at a CDN. |
| Permanent SEO-safe 301 redirect from HTTP to HTTPS (in the hosting settings, near the certificate options) | Sends every http request to https. | A second HTTPS rule in .htaccess
or a plugin; the SSL extension may offer the same toggle on its own screen. |
| Domain aliases | Extra domain names that serve the same site, with an option to redirect with a 301 instead of serving a copy. | Aliases left serving content create full duplicate sites. Aliases that redirect to the non-preferred host add a hop. |
| Hosting type set to forwarding | Turns a whole domain into a redirect to another address, with a choice of permanent, temporary or frame forwarding. | Temporary forwarding where the move is permanent; frame forwarding, which hides the real address and is not a redirect at all. |
| Additional nginx directives (Apache & nginx Settings) | Raw nginx configuration for the domain. | Rules that repeat panel settings; rules that assume a different hostname. |
| Additional Apache directives (Apache & nginx Settings) | Raw Apache configuration for http and https. | Same as above, and only used when Apache is handling the request. |
Edit rules only through these boxes, not in the generated configuration files on disk. Plesk rebuilds those files when settings change or the server is updated, and hand edits there are lost without warning.
# Additional nginx directives: page moves only.
# Host and HTTPS are left to the panel settings.
location = /opening-times.html { return 301 /visit-us/; }
location ^~ /old-shop/ { rewrite ^/old-shop/(.*)$ /shop/$1 permanent; }
Where cPanel keeps redirect settings
cPanel groups most of this under its Domains section. Again, labels differ a little between versions and hosting companies, who can hide or rename features.
- Force HTTPS Redirect. A per-domain switch on the Domains screen. It only becomes available once a valid certificate covers the domain.
- Redirects. A form that creates a redirect from a domain or path to another address. You choose permanent (301) or temporary (302), how www should be handled, and whether it is a wild card redirect that carries the rest of the path over to the destination.
- Addon and parked (alias) domains. Extra names for the account. An alias serves the same files as the main domain unless you add a redirect for it.
- File Manager. Where you can see the
.htaccessfile the Redirects form wrote to. Turn on the option to show hidden files, because names starting with a dot are hidden by default.
Because the Redirects form writes RewriteRule lines into .htaccess, it can
conflict with rules already in that file, such as a WordPress block or a hand-written HTTPS rule. The
form also sometimes produces patterns more permissive than you intended, such as a wild card redirect
on the root that sends every page to the new site's homepage. Open the file after each change and read
what was added.
# typical lines left by a panel redirect form
RewriteCond %{HTTP_HOST} ^example\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.co\.uk$
RewriteRule ^old-menu$ "https\:\/\/www\.example\.co\.uk\/menu\/" [R=301,L]
Those escaped slashes and dots are valid and harmless, just hard to read. You can tidy them by hand once you are sure the rule is right.
Finding which layer sent the redirect
The Redirect Checker shows every hop and its status code. To tie each hop to a setting, compare it with the logs and headers.
- Look at the target. A hop that only changes http to https is an HTTPS rule; one that only adds or removes www is a host rule; one that changes the path is a page redirect. That narrows the search to one kind of setting.
- Check the logs. Plesk keeps separate logs for nginx and Apache, visible from the
domain's Logs page; the files whose names include
proxybelong to nginx. If a 301 appears in the nginx log but the request never appears in the Apache log, nginx answered it, so the rule is a panel setting or in the nginx box. - Switch off one at a time. On a quiet period, untick one panel option and re-test in a private window. If the hop disappears, you have found its owner.
- Check the application last. WordPress redirects to the address stored in its site settings. If panel settings say non-www but WordPress is set to www, the two will fight, producing either a chain or a loop.
curl -sI http://example.co.uk/opening-times.html | grep -iE "^(HTTP|location|server|x-)"
curl -sI https://example.co.uk/opening-times.html | grep -iE "^(HTTP|location|server|x-)"
Common clashes and what they look like
| Symptom in the checker | Usual combination | Fix |
|---|---|---|
| http to https, then non-www to www, two hops | Panel HTTPS redirect plus a separate www
rule in .htaccess or WordPress | Set the preferred domain in the panel and delete the file rule, or write one rule that does both. |
| Loop between www and non-www | Preferred domain set to one form, WordPress site address set to the other | Make WordPress and the panel agree. |
| Loop between http and https | Panel HTTPS redirect plus a CDN connecting to the server over plain http | Change the CDN to connect over https, or move the HTTPS redirect to the CDN only. |
| Alias domain lands on the homepage for every page | Alias or forwarding set to a fixed address rather than carrying the path | Use the alias 301 option or a rule that keeps the path. |
| Alias domain shows the site with no redirect | Alias serving content, redirect option left off | Switch on the alias redirect so it returns a 301 to the main domain. |
| 302 on a permanent move | Forwarding or the redirects form left on temporary | Change the type to permanent. |
The fix, step by step
Step 1
List every redirect setting on the subscription
Open the domain in the panel and note the preferred domain, the HTTPS redirect
option, any aliases and their redirect setting, the hosting type, and the contents of the additional
nginx and Apache directive boxes or the cPanel Redirects list. Then read every .htaccess
file in the web root, and check the site address in WordPress or your application. Write the list down
so you can see duplicates side by side.
Step 2
Work out which layer answers first
Run
the homepage and a few inner pages through the Redirect Checker from http, https, www and non-www starting
points. For each hop, decide from its target whether it is an HTTPS, host or page redirect, and use the
nginx and Apache logs, or switching settings off one at a time, to confirm which layer sent it. On Plesk,
also confirm whether proxy mode is on, because that decides whether .htaccess is read at
all.
Step 3
Set the preferred host and HTTPS in one place
Choose one layer for the site-wide rules. On Plesk the simplest is the preferred
domain setting plus the SEO-safe HTTPS redirect; on cPanel it is the Force HTTPS switch plus one host
rule. If a CDN already handles them, switch the panel options off instead. Delete matching rules from
.htaccess, the directive boxes and plugins, and make the WordPress site address use the
same host and https.
Step 4
Point aliases and extra domains straight at the final host
For each alias, parked or addon domain, make sure it returns a permanent redirect rather than serving a copy of the site, and that the redirect goes directly to the https address on your preferred host with the path kept. Check forwarding domains for temporary codes and frame forwarding and change them to permanent forwarding. Make sure each extra name has a valid certificate so https requests do not fail first.
Step 5
Keep page redirects in one file or box
Decide where individual moved pages will live: a redirect plugin, .htaccess,
or the additional nginx directives box. Move existing page redirects there, point every one directly
at its final address, and remove copies from other places. Remember that the nginx box answers before
Apache and WordPress, so a stale rule there wins over anything you change later, and is easy to forget
because it is on a settings screen.
Step 6
Clear caches and trace from every starting point
Clear any server, plugin or CDN cache that may be holding old redirect responses, then test in a private browser window rather than your everyday one, which may have cached 301s. Run the Redirect Checker again on the same URLs from every starting variation. Each should reach the final page in one hop, with no 302s on permanent moves and no alias domains serving content.
Panels and WordPress together
Many panel-hosted sites are WordPress, and WordPress adds its own layer. It stores the site address and WordPress address in its settings and redirects any request for a different host to the stored one. Redirect plugins and SEO plugins can add more. A few rules keep the two worlds apart:
- Let the panel or CDN own https and www. Set WordPress's two addresses to exactly the same form, so its own redirect never fires in normal use.
- Let one plugin own page redirects, and do not also add them to
.htaccessor the nginx box. - Leave the
# BEGIN WordPressblock in.htaccessalone and put any hand-written rules above it. WordPress may rewrite the lines between its markers when permalinks are saved. - If you use a Plesk WordPress management tool or a cPanel installer, check whether it offers its own https or www option, and make sure it agrees with the panel.
Keeping it tidy
- Record in one place which layer owns host, HTTPS and page redirects for each site on the server.
- When adding a new domain or alias, set its redirect behaviour at the same time as its certificate.
- After panel or server upgrades, re-run the Redirect Checker; generated configuration may change.
- Review the directive boxes whenever the site is rebuilt, because they are rarely looked at and outlive the pages they mention.
1. Where is the www redirect setting in Plesk?
In recent Plesk versions it is in the domain's hosting settings, reached from the domain under Websites and Domains, where a preferred domain option lets you choose the www form, the non-www form or none. Choosing one makes Plesk send the other with a permanent redirect. Menu names differ slightly between versions and themes, so look for the hosting settings of the domain. Once it is set, remove any www rule you added in .htaccess, the directive boxes or a plugin.
2. Why is my .htaccess redirect ignored on Plesk?
The most likely reason is that Apache is not handling the request. If the domain serves PHP through nginx alone, with proxy mode switched off in the Apache and nginx settings, .htaccess files are never read. Either turn proxy mode back on, or write the rule as an nginx directive in the additional nginx directives box. Also check that nothing earlier, such as a CDN or an nginx directive, has already redirected the request before Apache sees it.
3. Should I use the panel redirect or write my own in .htaccess?
For site-wide rules such as https and the preferred www form, the panel setting is usually the better choice: it is visible to anyone who manages the site, it survives file changes, and it is applied early. For individual page moves, a single file or a plugin is easier to maintain in bulk. The real rule is not which you choose but that each kind of redirect lives in only one place.
4. What is the difference between a domain alias and forwarding?
A domain alias is an extra name attached to an existing site. By default it serves the same content, which creates a duplicate copy, but Plesk and cPanel can make it redirect to the main domain instead. Forwarding turns a domain into nothing but a redirect to an address you give, with no site behind it. Use a redirecting alias when the extra name should follow the main site page for page, and forwarding for a simple pointer.
5. Is frame forwarding bad for SEO?
Frame forwarding shows the destination site inside a frame while the browser address bar keeps the old domain. It is not a redirect, so search engines see a near-empty page on the forwarding domain and the real content elsewhere, and visitors cannot bookmark or share the pages they are on. Some browsers and sites also block being shown inside a frame. For almost every purpose a permanent 301 forward is the better choice.
6. Why does cPanel say Force HTTPS Redirect is unavailable?
cPanel only allows the switch when a valid certificate covers the domain, including the www form if you use it. If the certificate is missing, expired or has not yet been issued by the automatic certificate service, the option stays greyed out. Check the SSL or TLS status page in cPanel, run the automatic certificate check if your host offers it, and make sure the domain's DNS points to the server so the certificate can be issued.
7. Why do I get a redirect loop after turning on the Plesk HTTPS redirect?
Usually because something between the visitor and the server is talking to Plesk over plain http. A CDN or proxy set to connect to the origin without encryption sends every request as http, Plesk redirects it to https, the CDN repeats the request over http, and the loop continues. Set the CDN to connect over https with a valid certificate on the server, or turn the Plesk option off and let the CDN do the upgrade.
The Redirect Checker follows each URL through its full chain, recording every status code, Location header and hop time, and flags long chains, loops, 302s that should be 301s and HTTPS gaps.
Open Redirect Fixes โ