WordPress.org

Support

Support » Multisite » Disabled multisite – redirecting subdomain posts to domain posts

Disabled multisite – redirecting subdomain posts to domain posts

  • remodelvintage
    Member

    @remodelvintage

    Hey there,
    I have disabled the multisite functionality and also restored the htaccess file after I imported the blog (subdomain) posts to my main site.

    I now want the blog urls to be redirected to the imported post urls on my main site, note that the permalink structure was different on my blog as well
    from: blog.mainsite.com/2013/08/postname
    to: mainsite.com/postname

    i tried

    RewriteCond %{HTTP_HOST} blog.mainsite.com [NC]
    RewriteRule (.*) http://www.mainsite.com/ [R=301,L]

    and also tried to redirect the urls one by one, as there were’t that many posts, nothing worked.

    can anyone help?

Viewing 1 replies (of 1 total)
  • If you want to redirect the posts, it’s this:

    RewriteCond %{HTTP_HOST} blog.mainsite.com [NC]
    RewriteRule (.*) http://www.mainsite.com/$1 [R=301,L]

    But since we’re doing /2013/08/postname to postname it’s this:

    RewriteCond %{HTTP_HOST} blog.mainsite.com [NC]
    RewriteRule ^([0-9]{4})/([0-9]{2})/(.*)$ http://www.mainsite.com/$3 [L,R=301]
Viewing 1 replies (of 1 total)
  • The topic ‘Disabled multisite – redirecting subdomain posts to domain posts’ is closed to new replies.