Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
-
Opening a Plesk site in a browser returns this error
ERR_TOO_MANY_REDIRECTS
-
The problem may start after enabling Google PageSpeed
-
Redirect checkers, like redirect-checker.org, show that the site is redirecting to the
www.
subdomain and back again
The number of redirections can be checked with these commands. If they're under 4, they're fine:
-
For one domain
# curl -s -k -L -I example.com | grep -E '301|302' | wc -l
-
For all domains
# plesk db -Ne "select name from domains" | xargs -i sh -c 'printf "{} " && curl -s -k -L -I {} | grep -E "301|302" | wc -l'
Cause
There's more than one redirect configured in the site, which results in a loop, sending traffic back and forth between the naked domain (example.com
) and its www.
subdomain (www.example.com
).
This can happen if the redirection is already configured in .htaccess
, in Apache & nginx settings, or in the web application's settings (e.g. WordPress, Joomla, Drupal, etc.).
Resolution
To fix the issue, one of the redirects has to be disabled. To disable the ones from Plesk, follow these steps:
-
Log in to Plesk
-
Go to Domains > example.com > Hosting
-
Change Preferred domain to None and press OK
If the problem continues, more rules may be present:
-
Remove any redirect rules under Domains > example.com > Apache & nginx
-
Remove any redirect rules in
.htaccess
. For example:Redirect 301 /index.html http://www.example.com/
Comments
0 comments
Please sign in to leave a comment.