• Resolved GeddeDev

    (@ggedde)


    Is there some sort of setting I need to do with WP Network Setup to get Server redirects to work.

    I am currently trying to do a server redirect from site-c.com to site-b.com and the same with www.

    Here are my redirects:

    Source URL / [Ignore Case] [Ignore Slash]
    Query Parameters: Ignore all parameters
    Match: URL and server
    Server: https://site-c.com
    When matched: Redirect to URL with HTTP code 301 - Moved Permanently
    Matched Target: https://www.site-b.com
    Unmatched Target: https://www.site-b.com
    Group: Redirections Position 1
    
    Source URL / [Ignore Case] [Ignore Slash]
    Query Parameters: Ignore all parameters
    Match: URL and server
    Server: https://www.site-c.com
    When matched: Redirect to URL with HTTP code 301 - Moved Permanently
    Matched Target: https://www.site-b.com
    Unmatched Target: https://www.site-b.com
    Group: Redirections Position 1


    However, WP Network Multi-site is redirecting site-c.com to site-a.com and it seems that happens before redirection can take any action.

    Here is what I have in my wp-config:

    define( 'WP_ALLOW_MULTISITE', true);
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );
    define( 'DOMAIN_CURRENT_SITE', 'www.site-a.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    define( 'ADMIN_COOKIE_PATH', '/' );
    define( 'COOKIE_DOMAIN', '' );
    define( 'COOKIEPATH', '' );
    define( 'SITECOOKIEPATH', '' );
    define( 'NOBLOGREDIRECT', 'https://www.site-a.com' );

    If I exit; my wp-config file it will stay on site-c.com so I know that it is getting to my website and wordpress. It just seems that wordpress is redirecting first before redirection has a chance.

    Does it have something to do with DOMAIN_CURRENT_SITE or NOBLOGREDIRECT?

    Is there a way to have redirection handle the Server redirects for me so I don’t have to hard code them in PHP or my Web Server?

    Thanks

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

    (@johnny5)

    If something is performing a redirect before Redirection then you will need to stop that happening, or get Redirection to export to a suitable format that happens before the other redirect.

    Thread Starter GeddeDev

    (@ggedde)

    What I’m saying is that the redirect is happing from WP Network Multi-Site being enabled. I have disabled all other plugins and it is still doing the same thing. So I can’t stop that as that is part of WP Network Multi-Site.

    So the question is if Redirection “Server” redirects work with WP Network Multi-Site enabled?

    If so, then I need to know how to configure it properly. Can you see if the above configuration looks correct or if there is something special I need to do in the WP Network Multi-Site configuration to get it to work properly or if my redirects need to be edited.

    Do you know if it is better to enable the Plugin via the Network Admin or to enable it individually for each site? Or does that not matter?

    Thanks

    • This reply was modified 8 months ago by GeddeDev.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Server Redirects not working with Network subdomain Multi-Site’ is closed to new replies.