• Resolved kuros61099

    (@kuros61099)


    I have a WordPress page behind a reverse proxy. The home page and the admin section are work correctly, but when I want to navigate to a sub page like /test, I get an 301 redirect to https://[HOSTNAME OF PROXY DESTINATION]/test. Why do I get this redirect, so that the sub pages can not be viewed.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • For me, the subpage redirects to /erp/, not an IP. I can’t figure out where that comes from. WordPress obviously has the right domain as the siteurl and home, which is correct. You must have stored the “erp” identifier somewhere else.

    Thread Starter kuros61099

    (@kuros61099)

    Thats correct erp is the hostname of my proxy destination as I wrote: I get redirected to https://[HOSTNAME OF PROXY DESTINATION]/test. Have you an idea where to look for this? Because I already searched through the hole DB for that, but could not find it.

    Thread Starter kuros61099

    (@kuros61099)

    I found it. It was a configuration mistake. The correct hostname was send in the x-forwarded-host header and the host header contains the hostname of my proxy destination. So I forget to tell wordpress to use the value from x-forwarded-host as host and not the one from the host header. This snippet added to wp_config.php did the trick:

    if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
    $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
    }
    • This reply was modified 2 months, 3 weeks ago by kuros61099.
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.