Applicable to:
- Plesk Onyx for Linux
- Plesk Onyx for Windows
Symptoms
-
When trying to open a website
example.com
in a browser, the following error is shown:PLESK_INFO: ERR_TOO_MANY_REDIRECTS
-
Sometimes error starts occurring after enabling Google PageSpeed.
-
Redirect checkers like redirect-checker.org shows that
example.com
is redirecting towww.example.com
and back again.
Cause
Redundant redirects lead to an infinite redirect loop.
Resolution
Such an issue can occur if redirect is already configured in the.htaccess
file, in Apache &Nginx Settings, or in the web application's (e.g. WordPress, Joomla) settings.
To fix the issue it is required to disable redirects in Plesk:
-
Log in to Plesk.
-
Navigate to Domains > example.com > Hosting Settings.
-
Change Preferred domain value to
None
and click OK: -
Remove redirect rules under Domains > example.com > Apache & Nginx Settings, if any.
-
Remove redirect rules in the
.htaccess
file like the following:CONFIG_TEXT: Redirect 301 /index.html http://www.example.com/
Additional information
Note: The number of redirections can be checked with the commands below. If result <4, redirections are fine:
-
For a specific domain:
Note: change the "example.com" domain in the command below to the correct one.
# curl -s -k -L -I example.com | grep -E '301|302' | wc -l
-
For all the domains:
# plesk db -Ne "select name from domains" | xargs -i sh -c 'printf "{} " && curl -s -k -L -I {} | grep -E "301|302" | wc -l'
Comments
7 comments
It drives me crazy and now I'm totally frustated to use plesk panel. Really hope in the future this bug could be fixed.
@Alwan Rosyidi It is not a Plesk bug, but a webserver "feature" when the ".htaccess" instructing server send redirect to www, while the website code sending opposite redirects to non-www URL. Webserver sending all redirects to client browser which in turn have protection from redirect loops.
Robert Asilbekov . if don't about a plesk bug.. i have 11 website on my webhost edition onyx? why all sites giving same error? Yes?
@Furkan Başer
As it was explained earlier, this particular issue is caused by the discrepancy of settings defined in web service configuration and web application itself.
Plesk must ensure that rewrite rules configured by a user for Apache or Nginx, or the ones defined in '.htaccess' are applied, even if it creates a conflict the application code, which results in the error.
I just recently started getting this error myself. When a few days ago, i could just click the button "Sync" and it would take a staging site and point it to the live site without any issue. Now, when you click sync it will start and then crash saying too many redirects. When you go to the live site you the only thing that shows is the home page. Ended up having to manually set the site up, but i hope this features starts working again. It is an extremely convenient feature.
@Reed, make sure that you don't have additional rewrite configurations in Apache & nginx settings. Also, check SEO 301 redirect option in Hosting Settings and make sure that you are not forcing the domain to www or non-www when your CMS configured inside to work with www or non-www only.
it not fic my problems
Please sign in to leave a comment.