• Hello,

    I work on a website, all was working fine on developpement phase but I have to deploy it behind a reverse proxy. I have a problem on url redirection. It’s hard to describe the problem so I give you several cases when that bug happens :

    – When I type https://ip-address/wordpress-home, it works.
    – When I type https://ip-address/wordpress-home/, it redirect me on
    https://ip-address

    – When I type https://ip-address/wordpress-home?page_id=6, it works.
    – When I click on the https://ip-address/wordpress-home/?page_id=6 link from the home page, it redirect me on the https://ip-address page again.

    – When I type https://ip-address/wordpress-home/repository/, it works.
    – When I type https://ip-address/wordpress-home/repository, it redirect me on https://ip-address/repository/.

    I tried lots solutions and workarounds that solved similars problems, but no one works (it’s often even worse). I think the problem come from how the PHP deals with url because when I request a specific file, for example https://ip-address/wordpress-home/wp-login.php, it always works.

    My configuration :

    Apache reverse proxy config file

    ProxyRequests On
            ProxyVia On
            <Proxy *>
                    Order deny,allow
                    Allow from all
            </Proxy>
            ProxyRequests On
            ProxyPreserveHost On
            ProxyPass /wordpress-home balancer://clusterwordpress/
            ProxyPassReverse /test balancer://myclusterapache/
    
            <Proxy balancer://myclusterapache>
                    BalancerMember https://private-ip:80
            </Proxy>
            <Proxy balancer://clusterwordpress>
                    BalancerMember https://other-private-ip:80
            </Proxy>

    Apache server config file (a test one, almost empty so I know that there are no interferences) :

    <VirtualHost *:80>
            ServerAdmin webmaster@localhost
            DocumentRoot /var/www/htdocs/wordpress
            <Directory />
                    Options FollowSymLinks
                    AllowOverride None
            </Directory>
            <Directory /var/www/htdocs/wordpress>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride None
                    Order allow,deny
                    allow from all
            </Directory>
    
            ErrorLog ${APACHE_LOG_DIR}/error.log
            LogLevel warn
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>

    Notes :
    – None of modications on the wp-config.php or redirection with Apache RewriteEngine already works.
    – The siteurl and home value are https://ip-address/wordpress-home both.
    I’ve checked them directly in the database with mysql.
    – I can’t change the Apache reverse proxy configuartion file because I am not root on this server.

    Thank you in advance.

    NB : sorry for my bad english.

  • The topic ‘Reverse Proxy and bad redirection on several url’ is closed to new replies.