• I just changed my personal blog to multisite since I’ll be adding other segments of to the site (shop, speaking, author, etc.). Therefore, I’m moving all of my blog posts from mydomain.com to blog.mydomain.com.

    I still want to keep mydomain.com to act as a portal to other sites, so I can’t do a universal redirect. My goal is to redirect *only* already-created blog posts from mydomain.com over to blog.mydomain.com. (I will eventually delete them from mydomain.com once the redirects work.) I’ve already copied my directory and database over to blog.mydomain.com, and this subdomain works great.

    I have almost 266 blog posts. I have already created individual 301 redirects for each blog post. However, Adding these redirects to my .htaccess file results in a 500 Internal Error.

    Here is how my .htaccess is set up:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^mydomain\.com [NC]
    RewriteRule (.*) https://www.mydomain.com/$1 [L,R=301]
    
    # Use PHP54CGI as default
    AddHandler fcgid54-script .php
    
    # BEGIN WPSuperCache
    # END WPSuperCache
    
    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    
    Redirect 301 https://www.mydomain.com/blog-post-title/ https://blog.mydomain.com/blog-post-title/
    ...
    (and so on with 250+ other 301 redirects)

    The strange thing is, when I do a 301 redirect *within* the main domain, it works:

    Redirect 301 https://www.mydomain.com/blog-post-title/ https://www.mydomain.com/other-blog-post-title/

    But when I redirect to the subdomain, it doesn’t (as in the first code snippet).

    The directory name of my subdomain includes dots (public_html/blog.domain.com), and I’m wondering if that might be the culprit, but I read in another forums that dots don’t matter (my host is Bluehost). I’m also wondering if it’s something to do with the A Record.

    Any help here?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Multisite: 301 Redirect Specific Links from Main Domain to Subdomain’ is closed to new replies.