• Resolved cwiki

    (@cwiki)


    I currently have two domains the resolve to the same wordpress site currently. This isn’t ideal so instead Id like to re-write domainA to domainB whenever domainA is used. I believe this should be easily completed using the Site Aliases feature.

    When using the Site Aliases feature, the rewrite from DomainA to DomainB does appear correctly in the config page however the Location returned in the site headers when accessing DomainA is also DomainA resulting in an infinite redirect loop.

    I’m not sure where in the stack this would be happening, as the site’s root domain is correct (DomainB) and the preview of the rewrite shows the DomainA->DomainB properly.

    Thanks for any help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Godley

    (@johnny5)

    How have you set things up?

    Thread Starter cwiki

    (@cwiki)

    Hey John!

    TLDR: Dynamic coding in the wp-config.php was causing a loop when using aliases.

    Thanks for the response. I did some thinking and decided too deep dive the code and figure out what what was going on. The redirection plugin uses the sites url setup in the settings panel for the redirection. So when entering an alias, from the “correct” url it shows the correct address as the destination. However, that target url is based on the site settings and if those are dynamic you are in for an adventure.

    wp-config.php

    define( ‘WP_HOME’, ‘https://’ . $_SERVER[‘HTTP_HOST’] . ‘/’ ); // Dynamic home url… caused loop
    define( ‘WP_SITEURL’, ‘https://’ . $_SERVER[‘HTTP_HOST’] . ‘/’ );

    Commenting out these lines and entering the site url from the admin panel fixed the issue.

    Best,
    CW

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Alias Domain Issue Infinite Loop’ is closed to new replies.