• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question too may redirects on wordpress sites

Stephan Griesel

Basic Pleskian
Not sure why this is happening but my WordPress sites seems to go redirect and then the "too many redirects" page shows. My static HTML sites are working fine, its just the WordPress ones giving issues. Any suggestions where to start troubleshooting?

Might it be something with Apache?

Ubuntu 14.04. Nginx. Plesk 12.5.30 Update #55
 
Last edited:
Hi Stephan ,

Please check your website .htaccess and check in your db table wp_options (siteurl & home)

wp-options-table.png
 
Hi Kamtec1,

Thank you for getting back to me.

I can see the htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

And the *_options table is specified like your screenshot, any other suggestions?

Please also see Nginx access log below, the http://wujieliulan.com/mnews link is somewhat of a concern for me:


197.221.44.50 - - [19/Dec/2016:00:35:22 +0100] "GET /127660.BIN_AUTOSSL_CHECK_P$

197.221.44.50 - - [19/Dec/2016:00:39:38 +0100] "GET /127660.BIN_AUTOSSL_CHECK_P$

173.208.175.242 - - [19/Dec/2016:00:57:28 +0100] "GET /readme.html HTTP/1.1" 40$

173.208.175.242 - - [19/Dec/2016:00:57:29 +0100] "GET /readme.html HTTP/1.1" 40$

173.208.175.242 - - [19/Dec/2016:00:57:30 +0100] "GET /readme.html HTTP/1.1" 40$

173.208.175.242 - - [19/Dec/2016:00:57:31 +0100] "GET /readme.html HTTP/1.1" 40$

173.208.175.242 - - [19/Dec/2016:00:57:32 +0100] "GET /readme.html HTTP/1.1" 40$

173.208.175.242 - - [19/Dec/2016:00:57:33 +0100] "GET / HTTP/1.1" 200 3743 "htt$

169.229.3.91 - - [19/Dec/2016:02:17:46 +0100] "7@\x15\xB8\xC8\xBF\xEAG\x80*po\x$

36.24.26.155 - - [19/Dec/2016:03:18:05 +0100] "GET http://wujieliulan.com/mnews$

185.86.0.216 - - [19/Dec/2016:06:05:09 +0100] "GET / HTTP/1.1" 200 3743 "-" "li$

185.86.0.216 - - [19/Dec/2016:06:05:51 +0100] "GET / HTTP/1.1" 200 3743 "-" "li$

122.116.91.59 - - [19/Dec/2016:06:33:49 +0100] "GET / HTTP/1.0" 200 3743 "-" "M$
 
Last edited:
Please check your "Hosting Settings" whether you have set a default prefix for your domain in Plesk, e.g. told Plesk to redirect all "domain.tld" traffic to "www.domain.tld" or vice versa. Remove that setting, instead use "none". Else, when you tell Wordpress to use the version WITH www and tell your web server to use the version WITHOUT www, it will keep redirecting back and forth. The same is true if you tell Wordpress that your domain is the one without WWW while you instruct the web server to always redirect to the www-version.
 
Thank you Peter. Let me just explain my scenario quickly. Not sure if this can be the cause.

I have 1 subscription set up in Plesk, under this one subscription I have all my other domains. Not sure if maybe the main subscription is causing the issue.
 
Tab "Websites & Domains", in the subscription/domain that you want to edit click "Hosting Settings", at the "Preferred domain" radio buttons choose "none", then save the setting.
 
This issue can occur, too, if you have an .htaccess file with Rewrite rules in a directory and a Wordpress installation in a directory that is descending from that directory. In that case the .htaccess directives of the lower level directories mix with the ones from the upper directory. For instance, if you are hosting a Wordpress installation in /httpdocs and another one in /httpdocs/subdomain, then the /subdomain installation will not work properly.
 
ok thank you Peter. I think the problem is with the subscription and all the other sites are running in lower directories. Can you please give me some information on how to check the 'rewrite rules'?
 
If your subdomains are not located in separate directories descending from your home directory as Plesk recommends it, then check whether you have a .htaccess file in the directory that your subscription domain is using. By default this should be /httpdocs. In that file (/httpdocs/.htaccess) you will normally find "Rewrite" statements. If you have any of these statements in the file, move your /httpdocs/otherdomains directories out to directories desceding from your home directory and change the webserver settings accordingly. It is not advised to nest websites into one another. It is much better to have separate directories for each domain and subdomain.
 
There is no reason to change your .htaccess configuration. I do not have an example how your individual installation shall look like. Have you understood what the issue is? You are nesting different intallations inside one another. The settings of the upper installation influences the settings of the lower level installation. Simply migrate your complete Wordpress installation into a separate directory that is not located underneath another one.
 
Yes I understand what you mean. Here is my directory structure:

/var/www/vhosts/*main_subscriptiondomain/

My httpdocs folder located here:
/var/www/vhosts/*main_subscriptiondomain/httpdocs/

My other domains located here:
/var/www/vhosts/*main_subscriptiondomain/*otherdomains_in_sub_directories

So to confirm all the domains in the subdirectory must move to?:
/var/www/vhosts/
 
This is the correct structure. From your description above I assumed that you had a structure like
/httpdocs
/httpdocs/subdomain
/httpdocs/otherdomain

The structure you are describing now is correct as it should be. Do not move anything.

Are all your "otherdomains" affected by the redirect issue?
 
It's most likely a redirect inconsistency between domain names. The siteurl and home entries of wp_options must match what other function tell the server to do. If that is not the case, you end in the redirection loop. Normally this is caused by a wrong hosting setting, second comes the .htaccess nesting. If neither of these are the case, you could try to change the siteurl and home entry in wp_options to the "other" value and test again. If that does not work, check what script has been called immediately before the issue occurs (access_log, error_log entries), maybe you can find the cause out by this method.
 
If
www.mydomain.tld
then change to
mydomain.tld

else
if
mydomain.tld
then change to
www.mydomain.tld

But if it is now working, can it be that after changing the default hosting setting (www/non-www/none) WAS the reason and you simply did not wait on the server restart interval to pass before?
 
Back
Top