WordPress.org

Ready to get started?Download WordPress

Forums

Multisite and category subdomains (10 posts)

  1. jernejk
    Member
    Posted 1 year ago #

    Dear all,

    I am setting up a wordpress site (hosted by hostgator in case it matters) and one of the requirements is to move (merge) existing blogger content to the new site.

    The situation is something like this:
    - existing blog is hosted at blogger, and is accessible through blog.myname.com subdomain
    - the new site will use mybiz.com domain
    - i want blog.myname.com to redirect to blog.mybiz.com where the new content is going to be

    I managed to get this concept working by installing multisite and creating a new blog.mybiz.com site and configuring this site to run on both, old and new subdomains. The problem with this setup is:
    - I need to maintain two sites, which is really not something I want to do
    - I'm not sure how easy it is to aggregate feeds from blog.mybiz.com to the main mybiz.com site

    One option is to create a category menu on mybiz.com site and have the old blogs at /blog/category/blog/ then redirect blog.myname.com to this URL. But the problem is, the browser URL is replaced with the new URL, which I don't really like.
    I've tried a subdomain plugin (translating categories to subdomains) but it does not seem to work with multisite (due to that NOBLOGREDIRECT thingy).

    I know multisite is maybe not the best for this particular usecase, but I plan to host other, unrelated sites in the future, so I could really benefit from this setup.

    Thank you.

  2. Wait... why is this Multisite?

  3. jernejk
    Member
    Posted 1 year ago #

    Because I can't figure subdomains with multisite (without setting up a subdomain as a new site).

  4. jernejk
    Member
    Posted 1 year ago #

    It seems I can do a simple redirect from blog.myname.com to the new blog with sth like:

    RewriteCond %{HTTP_HOST} ^blog\.myname\.com$
    RewriteRule ^/?$ "http\:\/\/mybiz\.com\/blog\/category\/blog\/" [R=301,L]

    This needs to be before the multisite htaccess rules or it doesn't work (for reasons I don't uderstand).

    Is there a way to change this rule in a way that retains blog.myname.com URL in the browser?

  5. Jesús Franco
    Member
    Posted 1 year ago #

    Don't use the Redirection flag on your rewrite rule ;-)

  6. Read http://halfelf.org/2012/htaccess-anarchy/ for more on how to get .htaccess working like that on Multisite.

    And yes, always put your custom rules above WordPress. Because otherwise you call WP multisite times while redirecting.

  7. jernejk
    Member
    Posted 1 year ago #

    @Jesus even if I remove R=301 the browser is redirected.

    @Ipstenu thanks for the link... I'm just not sure that is meant to retain browser URL as he's using R=301 everyhere...

  8. She. That's my site.

    The concepts for how to handle redirect with multiple domains and subdomains is what you needed :) You can fiddle with R as you need.

  9. jernejk
    Member
    Posted 1 year ago #

    Ups, sorry :-)

    I understand the concept here... if I use this (modified for my site):

    RewriteCond %{HTTP_HOST} ^blog\.ipstenu\.org [NC]
    RewriteRule ^(.*) http://ipstenu.org/$1 [L,R=301]

    it works. However, removing R=301 still results in redirect, but this time it's 302. My guess is it has to do something with multisite.

  10. Depends on where it's redirecting to.

    domain.com or the signup page?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags