Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ron Rennick

    (@wpmuguru)

    The domain mapping plugin implements 301 redirects to mapped domains.

    For the rewrite you have created you can add a condition that checks for the source domain

    RewriteCond %{HTTP_HOST}   ^www\.example\.com
    RewriteRule ^/(.*)         https://www.site.com/$1 [L,R]
    Thread Starter darrylxxx

    (@darrylxxx)

    Hi Ron, many thanks for your comment. I don’t have much experience with domain mapping and 301 Rewrites, so I’d like to ask again in more specific terms if you don’t mind!

    The same page/post is currently on each site (I migrated everything to two WP sites ‘as is’ and I will advise the client on making each more unique going forward). What would I put into the .htaccess file for:

    Old url slug: /newsitem144/hse-acop-l143-managing-and-working-with-asbestos-released
    New site 1: https://www.hberm.com
    New site 2: https://www.hberm.ie

    The .htaccess file was like this:

    RewriteOptions inherit
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    RewriteCond %{HTTP_HOST} ^hberm\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.hberm\.com$

    Thanks again,
    Darryl

    Plugin Author Ron Rennick

    (@wpmuguru)

    If the content is at the same path then you don’t need any rewrites in your htaccess.

    Remove the rule(s) you added and visit the settings -> permalinks screen & check that the permalink settings are the same. Then check to see if that fixes the 404.

    Thread Starter darrylxxx

    (@darrylxxx)

    I am most sorry! I forgot to add the new url slug. The url IS different in most cases (500 per site).

    Old url slug: /newsitem144/hse-acop-l143-managing-and-working-with-asbestos-released
    New url slug: /blog/hse-acop-l143-managing-working-with-asbestos-released/
    New site 1: https://www.hberm.com
    New site 2: https://www.hberm.ie

    Darryl

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘301 redirects on second site’ is closed to new replies.