• Resolved sensibilitypatterns

    (@sensibilitypatterns)


    I’ve got a MultiSite installation that was running two sites (my main site and a separate blog). Now I’ve installed a new site that has the blog incorporated. It’s working fine at https://sensibility.com/tours/blog (other than the fact that my images all went missing when I moved the WP file to the new blog … but that’s another story, and I’m slowly fixing all the broken/missing images).

    Because there are other sites out there that link back to my original blog URL, I want to place a redirect link at https://sensibility.com/englandblog that points to the new blog. However, I can’t figure out how to do that, since the original installation wasn’t running from that subfolder but from within the multisite framework. Where am I supposed to place a redirect?

    Totally confused after Googling for over an hour.

    Thanks.

    JC

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Easiest way is to delete https://sensibility.com/englandblog from your network and then do a .htaccess redirect for it.

    Thread Starter sensibilitypatterns

    (@sensibilitypatterns)

    Okay, thanks. I was kind of hoping I wouldn’t have to delete the old blog just yet, as many of my images didn’t move over, and I’ve been fixing those one by one. Once I’m ready, I’ll do the .htaccess redirect.

    Cheers,
    Jennie

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You don’t HAVE to delete it, but once you do the .htaccess redirect, you may as well have :/

    How did you move the posts? If you did the export/import via WP it should have brought them over.

    If you did it manually, then it’s actually not TOO terrible (though make a DB backup FIRST ?? )

    1) Copy all the files from the second blog’s upload folder (probably /wp-content/uploads/sites/2/ ) to the main site (default of /wp-content/uploads/ )

    2) Search/replace all the post content in the MAIN site and just look for <img src="https://sensibility.com/englandblog and replace with <img src="https://sensibility.com/

    You shouldn’t have to do anything else.

    Thread Starter sensibilitypatterns

    (@sensibilitypatterns)

    Well, this blog started out in 2006 on Blogger, then moved to WordPress in 2010. Turns out the Blogger images didn’t import originally — they were all just old links back to a deleted blog’s images. I don’t know how the images were actually working with the blog deleted years ago, but they were until recently. I’m now re-uploading all those original images so I have them actually in the WP folder where they belong. For the more recent images that should have exported/imported correctly, I did the search and replace, and that didn’t work, but I still managed to find the images in the Media Library. I have had problems before moving WP sites with the export/import tool, so I should have known better and used a more robust plugin. Oh, well.

    Thanks for the .htaccess tips. If I deactivate the old blog from my multi-site admin dashboard, the images, etc. will still be sitting in their subfolder, correct? I’ll just repoint to the new blog and only delete the old folder once I’m sure i have all the images, right?

    Thanks,
    Jennie

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    I don’t know how the images were actually working with the blog deleted years ago, but they were until recently.

    Ah, I do. Google didn’t delete them until recently. I know, weird, right?

    If I deactivate the old blog from my multi-site admin dashboard, the images, etc. will still be sitting in their subfolder, correct?

    If you archive/deactivate YES. If you DELETE it will… delete.

    Thread Starter sensibilitypatterns

    (@sensibilitypatterns)

    Well, the images are still there, because clicking the images in the old posts takes me to a blogger page. I’m slowly grabbing all of these and uploading them so I don’t lose them forever!

    Now, I’ve deactivated the old blog and am ready to add the .htaccess redirect, but there are so many conflicting redirect codes in the WPMUDEV universe that it’s dizzying! Here’s what I’ve narrowed down to:

    RewriteCond %{HTTP_HOST} !^sensibility.com/englandblog
    RewriteRule (.*) https://sensibility.com/tours/$1 [R=301,L]

    …but I’m not actually sure about bits of that (like the [R=301…] bit at the end). Any help for me?

    Thanks,
    Jennie

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Well, the images are still there, because clicking the images in the old posts takes me to a blogger page. I’m slowly grabbing all of these and uploading them so I don’t lose them forever!

    Then they may have just blocked hotlinking. Blogger’s been weird lately.

    RewriteCond %{HTTP_HOST} !^sensibility.com/englandblog
    RewriteRule (.*) https://sensibility.com/tours/$1 [R=301,L]

    This says “If you ARE NOT going to sensibility.com/englandblog then we’re redirecting you to sensibility.com/tours/

    If you want it to be “Anyone who comes to englandblog goes to tours” then it’s this:

    RewriteRule ^englandblog(.*) tours$1 [R=301,L]

    Just the one line ??

    Thread Starter sensibilitypatterns

    (@sensibilitypatterns)

    Many thanks. That’s hugely helpful, and I’ll get the .htaccess file updated now.

    One more quick question. When I revamped my website two years ago, I accidentally changed my permalink structure without realizing it. This broke a ton of incoming links to my site (but I didn’t realize it for over a year), and I’m wondering if a redirect would help to correct those? I can’t change the permalink back the way it was, or I’ll lose newer incoming links (boy, I wish I’d known to double-check the permalink structure when I redid the site!).

    My old links looked like this: https://sensibility.com/patterns/the-elegant-ladys-closet/

    But now that same link is https://sensibility.com/blog/patterns/the-elegant-ladys-closet/

    Another post sample: https://sensibility.com/tips/video-tutorial-how-to-understitch-a-seam/

    Is now: https://sensibility.com/blog/tips/video-tutorial-how-to-understitch-a-seam/

    So, basically, /blog/ got inserted in front of each category. Is there a way to redirect all incoming links that used to omit the /blog/ to include it instead, or will that mess up plain old links to the main site? Would I have to create redirect code for each and every post (shudder)?

    Thanks,
    Jennie

    Thread Starter sensibilitypatterns

    (@sensibilitypatterns)

    Hmmm…. Back again. I added the rewrite rule to my .htaccess file, but the redirect doesn’t work. In Safari, I get a blank white page when I load https://sensibility.com/englandblog. In Firefox, I get a “Sorry, this site no longer exists.” I’ve flushed my cache, and that’s still what I get.

    Here’s where I put the redirect:

    # Use PHP54 Single php.ini as default
    AddHandler application/x-httpd-php54s .php
    
    # BEGIN www. Prefix Removal
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\. [NC]
    RewriteCond %{HTTP_HOST} !^sensibility\.com [NC]
    RewriteRule ^(.*)$ https://sensibility.com/$1 [R=301,NC,L]
    </IfModule>
    # END www. Prefix Removal
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    RewriteRule ^englandblog(.*) tours$1 [R=301,L]
    </IfModule>
    # END WordPress

    It’s there at the end. Did I put it in the wrong spot?

    Thanks,
    Jennie

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You did ?? NEVER mess with the WP rules. Leave them at the bottom.

    # Use PHP54 Single php.ini as default
    AddHandler application/x-httpd-php54s .php
    
    # BEGIN www. Prefix Removal
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\. [NC]
    RewriteCond %{HTTP_HOST} !^sensibility\.com [NC]
    RewriteRule ^(.*)$ https://sensibility.com/$1 [R=301,NC,L]
    </IfModule>
    # END www. Prefix Removal
    
    # Moving to tours
    RewriteRule ^englandblog(.*) tours$1 [R=301,L]
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    </IfModule>
    # END WordPress
    Thread Starter sensibilitypatterns

    (@sensibilitypatterns)

    Ah ha! That did the trick (though I changed the redirect to tours/blog$1).

    THANK YOU! Great to see how this is done and finish it up.

    Cheers,
    Jennie

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How do I place a redirect for a multisite blog I have moved/revamped?’ is closed to new replies.