The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Disabled multisite - redirecting subdomain posts to domain posts (2 posts)

  1. remodelvintage
    Posted 2 years ago #

    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?

  2. 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]

Topic Closed

This topic has been closed to new replies.

About this Topic