• Resolved finglish

    (@finglish)


    I have multiple domains pointed to the same server with the structure:

    my.domain.com
    my.domain.fi
    my.domain.dk
    my.domain.no

    I want to make redirects specific to each domain, but when I try to use match:”URL and server” the redirect does not work. “url only” does work, but i need them to be domain specific, e.g.

    my.domain.fi/products = https://my.domain.fi/tuotteet/
    my.domain.dk/products = https://my.domain.dkprodukter/
    my.domain.no/products = https://my.domain.dk/vare-produkter/

    Setup:
    Source URL: /products
    Match: URL and server
    server: https://my.domain.fi
    match Target: /tuotteet/

    ERROR
    Check redirect for: https://my.domain.fi/products/
    Expected: 302 to https://my.domain.fi/tuotteet/
    Found: 404
    Agent: Not using Redirection

    —-

    This issue is specifically with “URL and server”. “url only” redirections work without issue, but don’t meet my use case.

    I have site caching disabled and have hard cleared the cache, but no luck.

    Where am I going wrong?

    • This topic was modified 3 years, 9 months ago by finglish.
    • This topic was modified 3 years, 9 months ago by finglish.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter finglish

    (@finglish)

    I dug into the plugin and figured out that my $_SERVER[‘SERVER_NAME’] isn’t updating based on source. so it always points to https://my.domain.com. where $_SERVER[‘HTTP_HOST’] changes to the correct name.

    Commenting out the

    if ( isset( $_SERVER['SERVER_NAME'] ) ) {
       $host = $_SERVER['SERVER_NAME'];
    }

    in

    public static function get_server_name()

    solves my issue, but patching means I can’t update the plugin.

    Plugin Author John Godley

    (@johnny5)

    It sounds like your server isn’t correctly setting the environment variables.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘URL and server redirections fail’ is closed to new replies.