Site specific 301 redirects on multi site

Hello

I have the following problem:

1. I created 3 new versions of 3 websites, which were on different servers with different domains

2. now all 3 new websites are on one wordpress multisite install and I will map the three corresponding domains to the websites

3. I need to create 301 redirects of the old websites pages to the new domains

4. but some of the old domain paths of the different websites are the same

5. how can I create site specific 301 redirects in my htaccess file?

Example:

Website #1

Redirect 301 /english/ http://www.domain1.com/en/

Website #2

Redirect 301 /english/ http://www.domain2.com/en/

So I need to tell the htaccess file somehow that the redirect for Website #1 will only happen, if domain 1 is entered.

Hope you know a solution to this!

  • Predrag Dubajic
    • Support

    Hey @flobrunner,

    Hope you’re doing well today :slight_smile:

    Can you please give us some more info about your setup.

    Old websites were on each on single WP installation, right?

    Are they now all under the same Multisite installation or each new site is a different multisite installation, and is any of the old sites being used as the main site on the network?

    Looking forward to your response.

    Best regards,

    Predrag

  • flobrunner
    • Design Lord, Child of Thor

    Hi Predrag,

    The old websites were made with different CMS (Typo3 & Contenido) and I created them completely new.

    Now I have one Multisite installation (with the domain: new.maindomain.com) and 3 Subsites in (directories):

    new.maindomain.com/site1

    new.maindomain.com/site2

    new.maindomain.com/site3

    And I will map these sites to their domains:

    new.maindomain.com/site1 -> domain1.com

    new.maindomain.com/site2 -> domain2.com

    new.maindomain.com/site3 -> domain3.com

    domain1, 2 & 3 are not being used as the main site of the network.

    Hope that helps.

  • Adam Czajczyk
    • Support Gorilla

    Hey flobrunner,

    I hope you’re well today!

    If I understand you correctly (and I hope I do) this may be quite difficult task to achieve with .htaccess only. I’ve search some threads on our own forum and some other places and this solution seem worth giving a try:

    http://stackoverflow.com/a/26019354

    You will want to replace domains and adjust redirect rules to suit your needs but it looks like it should work.

    Let me know please if it helped!

    Cheers,

    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.