Unified subdomains and subdirectories

  1. wordOne

    The real bottom line is that some of us need to leverage good domain names so need everything in one place.

    I too have a requirement for both using the same domain name and it would be best to have one single server and I would handle load balancing/redundancy in the usual way that I handle large installations.

    I badly need site1.domain.com along with http://www.domain.com/user-blogs but it has been near impossible to get enough information together to figure this out. Using plugins is a temporary fix and the concern there is always that authors too often abandon their plugins and there is no upgrade path other than hiring someone to write it at the last minute when important upgrades come along.

    If anyone has information on this, concerning 3.5 installs, I and others would certainly appreciate it.

    Posted: 5 years ago #
  2. 3x7

    +1 here.

    I have a situation where a user is able to create own "subdirectory" from frontend, but it's only possible to create a "subdirectory", since I installed the "subdirectory MU" installation.

    Perfect scenario would be if I could offer them to choose from "subdomain" or "subdirectory" while creating a site (with explanation of benefits for each)

    2nd good way would also be, If I do a domain mapping from subdirectory to subdomain, so my question is if that would use the domain.url/user1 but show user1.domain.url in the url?

    basically, I prefer using subdirectory for better seo etc. but I rather have users use "subdomain" for promoting their sites, so the site should be nested in "subdirectory", but should show the "subdomain" in the url.

    Any help would be appreciated.

    thank you.

    Posted: 5 years ago #
  3. Ipstenu (Mika Epstein)
    Lead Plugin Wrangler

    Right now you would need to use a multi network plugin to do this.

    Posted: 5 years ago #
  4. 3x7

    Thank you, will try that out.

    There are few, is there any preference for wp 3.5?

    thx again.


    Posted: 5 years ago #
  5. Ipstenu (Mika Epstein)
    Lead Plugin Wrangler

    They all work about the same on 3.5

    Posted: 5 years ago #
  6. jbleep

    I am not an expert on it, but could probably figure it out. I know you said you want to do it through a control panel, but you should be able to put a redirect in .htaccess to accomplish the subdomain to folder translation pretty easily.

    Of course, this could be done internally in WP, but that may take a long time for you to get. I started http://alohacreek.com, which has a number of subfolders, a few months ago with subdomains, but switched over to subfolders fairly early on. Later, I learned more about .htaccess redirects. They can be pretty tricky, but you can do this sort of thing. I suggest you set it up on a local or test server and do some testing. You can get the .htaccess to rearrange the sections of the url however you want.

    Posted: 5 years ago #
  7. wordOne

    That would work for me.

    So basically, on my multi-domain setup, when I want an existing sub-domain to redirect to my multi-directory server, I would put something into the .htaccess.

    In .htaccess;

    Redirect 301 http://sub1.mydomain.com/ http://www.mydomain.com/sub1-replacement

    The above doesn't work, it's just an example something along those lines right.

    Posted: 5 years ago #
  8. jbleep

    Here is a "horibble example" I am pulling from something off the wall. the point is there is syntax that will allow you to use wildcards and such. I am on vacation, and I don't have time to research it right now/ If I can in the next day or two I will try to get you a better example. But here is some syntax along the lines of what you want:

    RewriteEngine On
    RewriteRule aw(.*)/index.htm$ xxx.php?aw$1/
    RewriteRule aw(.*)/index.phtml$ gys.php?aw$1/

    This is from some code I found on a website that was using 'illegal' keyword redirects. Where it comes from is not important. If you Google 'rewriterule htaccess' you will find examples of how to turn the stuff before the domain (zzzz.domain.com) into a variable that you put after it like this:

    Rewriterule (*.)mydomain.com mydomain.com/$1

    That would (if written correctly) take anything before mydomain and put it after the slash instead. Again, I don't know the syntax, just the concept and that you can do it. You can use wildcards but you can also do the specific ones you want really easily, something like:

    Rewriterule abc.mydomain.com mydomain.com/abc

    You can find examples of it by googling what I said.

    And the 301 if not what you are after. In the syntax you have it would redirect any 301 it finds (if there was one) to the url you have entered. This is not what you want. You want the Rewrite as I said above with something like [R 301] after it, which will tell google that it is permanrnt. And you don't reallly need that. The user accessing it does not need to know it is changing. That is something your program (including .htaccess) is handling, just like WP handles stuff without the user knowing.

    Posted: 5 years ago #

RSS feed for this topic


You must log in to post.

  • Rating

    29 Votes
  • Status

    This is plugin territory