The MU forums have moved to WordPress.org

Rewrite Subdomain to Subdirectory (10 posts)

  1. macronerd
    Member
    Posted 15 years ago #

    I've got WPMU successfully running on MAMP on my Mac. I am trying to rewrite a subdomain into a subdirectory.

    So : blog1.localhost.localdomain/wpmu/ should be rewrited to: localhost.localdomain/wpmu/blog1

    I've tried this rewrite rule with no luck:
    #rewrite subdomain to subdirectory
    RewriteCond %{HTTP_HOST} ^blog1\.localhost\.localdomain\.wpmu
    RewriteRule ^(.*)$ /blog1/$1 [L]

    Any ideas?

  2. SteveAtty
    Member
    Posted 15 years ago #

    Any reason why you want to do that?

    I could understand if you were moving to a new domain and you wanted to allow all your old links and search engine hits to still work and redirect from the old site to the new site but from your code you're not doing that.

  3. andrea_r
    Moderator
    Posted 15 years ago #

    Why not just reinstall it with the proper option selected?

  4. macronerd
    Member
    Posted 15 years ago #

    OK this is my first wpmu install so bear with me. From what I've read in the forums, subdomains are the recommended method over subdirectories, because of plugin incompatibilities right? So I chose subdomains for my test environment, however I would like it to appear to the user that I have subdirectories for my blogs, example blog1.site.com, displays as site.com/blog1.

    So how are folks with subdomains making their site appear as subdirectories? Or is it better just to reinstall with the subdirectories option?

  5. andrea_r
    Moderator
    Posted 15 years ago #

    "So how are folks with subdomains making their site appear as subdirectories?"

    Uh, they aren't. They're using subdirectories to start with.

    People pick subdomains over subfolders because the SEO is better. most plugin incompatibilities have been ironed out.

    If you're reading over threads int he forums, please be aware that the search on the *front* page is a little broken. there's a sticky thread also on the front page that details this. That search will give you a ton of old and outdated threads.

    So, please pay attention to the dates on the threads you're reading.

    I have to ask *why* you want to do this and if there were specific plugins you were looking at as being incompatible. Often people ask a question on one topic, but they are really trying to accomplish something else. :) Would help a lot if we knew what you were aiming for.

  6. macronerd
    Member
    Posted 15 years ago #

    My only reasons are that I prefer the url structure of subdirectories over subdomains, but didn't want to run into plugin incompatibilities with subdirectories. If most issues have been ironed out, then I will just do a reinstall and choose subdirectories. I probably did read some old threads as you mentioned, thanks for the help.

  7. MrMail
    Member
    Posted 14 years ago #

    My question is why are subdomains better for SEO? I'm tiring to decide on a subdomain or subdirectory install and would like to know the pros and cons of both.

  8. andrea_r
    Moderator
    Posted 14 years ago #

    because search engines see them as mostly separate sites. Subfolders are seen as part of the same site, as if they were just categories.

  9. ILoveWPMU
    Member
    Posted 14 years ago #

    Hi there. I can't stop reading threads about this subject.

    Andrea, it seems that you know all the answers :)

    For some projects wouldn't be better to have user's blogs in Subdirectory?
    I mean they create new content daily so it could be a good think.
    Also the links they are spreading to their blogs will count to our main site. Witch I think is great for SEO.

    I'm a bit confuse about what install path to choose. I would really appreciate your thoughts about this issue. Thanks ;)

    Andrew

  10. r-a-y
    Member
    Posted 14 years ago #

    I'm trying to do the opposite ;)

    I'd like only one of our subdirectory blogs to turn into a subdomain.
    Any pointers?

About this Topic