#StackBounty: #wp-admin #redirect #directory #installation #wp-config WordPress (behind HAProxy and Jetty), not multisite, in sub folde…

Bounty: 100

I am using an unusual setup to host 3 WordPress installations on CentOS 8 Linux.

In front I have HAProxy (to offload TLS), then I have Jetty configured for FastCGI and php-fpm and finally WordPress.

I am using the WordPress around a word game written in Pixi.js.

For several years now I have been using 3 different IP-addresses and 3 different domain names for the 3 language versions of my game: en, de, ru.

However my word game is not successful, so I have decided to give up the additional domain names and IP addresses and just use folders to serve my game:

  • wordsbyfarber.com/en
  • wordsbyfarber.com/de
  • wordsbyfarber.com/ru

This has worked well, I am not using multisite and I have set

define('WP_HOME', 'https://wordsbyfarber.com/en');
define('WP_SITEURL', 'https://wordsbyfarber.com/en');

in en/wp-config.php (same for de and ru) and also in the dashboard:


And already you can see my problem in the above screenshot:

While the user-facing websites work ok, the admin dashboard at /en/wp-admin/ immediately redirects to /wp-admin which is not ok, since I am not using multisite.

I have tried to solve the problem myself and searched a lot in the docs etc.

Also I wondered, who is doing the redirect, is it JS or PHP?

It seems to me that this is done by the PHP code of WordPress, which for some reason sends a new Location header:


As you can see in the above screenshot, when using wget – for some reason WordPress would remove /en string from /en/wp-admin path and redirect to the new location.

Why is it doing so and how to stop it?

I have tried to search in WordPress source code with:

find ./en/ -iname *.php| xargs grep -riw redirect_to

but wasn’t able to find the reason yet.

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.