• Hi,

    I have to migrate a wordpress to another server, using docker. The homepage works without the proxy (but the other pages not, even after updated the permalinks). I’m stuck for more than week, trying many things without success.

    Here is my the apache configuration of the docker :

    ServerName my-domain.fr

    DocumentRoot /var/www/html

    <Directory /var/www/html/ >
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    RewriteEngine On

    and the apache proxy conf :


    <IfModule mod_ssl.c>
    <VirtualHost *:443>

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    # allow htaccess by default
    <Directory /var/www/html>
    AllowOverride All
    </Directory>


    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined


    <Location "/my-subdirectory/">
    ProxyPass "https://localhost:8054/"
    ProxyPassReverse "https://localhost:8054/"

    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
    </Location>

    ServerName my-domain.fr
    SSLCertificateFile /etc/letsencrypt/live/my-domain.fr/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/my-domain.fr/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
    </VirtualHost>
    </IfModule>

    The directory in /var/www/html are like this :

    index.php log WP www

    All the wordpress files are in the WP directory.

    I define the home and site_url in wp-config like ths :

    define( 'WP_HOME', 'https://my-domain/my-subdirectory' );
    define( 'WP_SITEURL', 'https://
    my-domain/my-subdirectory/WP' );

    I checked the database, in wp_options, the settings are the same.

    I have the “ERR_TOO_MANY_REDIRECTS” error in the browser when I want to access the home page. I tried many configuration, with no success.

    Thanks in advance for any help.

    • This topic was modified 4 days, 21 hours ago by elyopiyop.
Viewing 1 replies (of 1 total)
  • You said you have tried many things without success—maybe you could mention a few of those, so I don’t suggest something you’ve already done.

    Here are a few things you can try to resolve the “ERR_TOO_MANY_REDIRECTS” issue:

    1. Permalinks

    Let’s start with the basics. Since you mentioned other pages not working after updating permalinks, I recommend navigating to Settings > Permalinks and re-saving them (in case you haven’t done that already). This will refresh the rewrite rules and might resolve issues with your subdirectory setup.

    2. WP_SITEURL and WP_HOME

    Make sure you have the WP_SITEURL and WP_HOME defined properly in your wp-config.php. The example you showed above seems off. Ensure that there are no extra spaces or line breaks in those constants, and it should look something like this:

    define( 'WP_HOME', 'https://my-domain.fr/my-subdirectory' );
    define( 'WP_SITEURL', 'https://my-domain.fr/my-subdirectory/WP' );

    3. .htaccess Configuration

    Since you’re using Apache and AllowOverride All is enabled, double-check your .htaccess file in the /var/www/html/WP directory.

    4. Proxy and Port

    In your Apache proxy configuration, you have:

    <Location "/my-subdirectory/">
        ProxyPass "https://localhost:8054/"
        ProxyPassReverse "https://localhost:8054/"
    </Location>

    Double-check that the internal Docker container is correctly mapped to port 8054 and that it’s accessible.

    5. SSL and HTTPS Redirects

    Since you’re using SSL, check if the proxy is conflicting with HTTPS redirection. Try temporarily disabling HTTPS redirects to see if that’s causing the loop.

    6. Logs

    Lastly, have you checked your Apache error and access logs (/var/log/apache2/error.log)? They might provide clues on what’s causing the issue.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.