The MU forums have moved to WordPress.org

Moving existing root installation to subdirectory: Where's the howto? (27 posts)

  1. mercator
    Member
    Posted 15 years ago #

    Hello,

    I have installed my WPMU in my root dir but would like to
    - move all WPMU files to a subdirectory, e.g., wordpress BUT
    - keep the adreess of the blog as it is (i.e., the user should not see that the adress is now mydomain.com/wordpress but mydomain.com)
    The reason for this is simple: Too many files in my root dir...

    I have searched here but did not find a satisfying answer. There must be an answer somewhere in here. Might anyone point me to the post?

    THANKS
    Mercator

  2. andrea_r
    Moderator
    Posted 15 years ago #

    The short answer is you can't.

  3. expat
    Member
    Posted 15 years ago #

    why not? why wont the settings in the blog admin take effect?

  4. andrea_r
    Moderator
    Posted 15 years ago #

    Because it's not the same as for single WP.

    The way the blogs are handled, MU has to be in the folder where the blogs are pulled off.

    Since you did search, you may have seen that none of those threads had a solution. I'm telling you it's because there is none.

  5. delayedinsanity
    Member
    Posted 15 years ago #

    Well hold up, are there other files in your root folder you're trying to serve from the web, or are you just trying to move the entire web root over? Because if you're just trying to move the web root so that you can keep your other files on the server organized elsewhere, there's no reason you couldn't (depending on your host) provide Apache with an alternate DocumentRoot and then provide an Alias for your other files if you needed to access them.

    More details are needed, because moving files is an easy task, it's the final result you want that determines the course of action.

  6. expat
    Member
    Posted 15 years ago #

    by my reading, he wants to re arranage the root folder for better organisation....

    root/<many files and folders>

    to

    root/wordpress/
    root/ipb/
    root/vB/
    root/drupal/ etc

    Looks to me you can set up virtual hosts

  7. andrea_r
    Moderator
    Posted 15 years ago #

    "move all WPMU files to a subdirectory, e.g., wordpress BUT
    - keep the adreess of the blog as it is (i.e., the user should not see that the adress is now mydomain.com/wordpress but mydomain.com)"

    See, you can do this with single WP, so I answered from that perspective.

  8. delayedinsanity
    Member
    Posted 15 years ago #

    @andrea_r: I'm sorry, I wasn't trying to say you answered incorrectly, not at all. I think I just read it from a different perspective; instead of doing this through Wordpress itself, the possibilities of what you can do with an Apache server and some know how are almost endless.

  9. andrea_r
    Moderator
    Posted 15 years ago #

    Oh, I know. :) Just clarifying. hopefully the OP will come back and let us know exactly what the issue is.

  10. expat
    Member
    Posted 15 years ago #

    well, why cant he put it into /wordpress/ and still keep the mydomain.com starting link?

    Just exactly how wordpress works?

    why cant i have /wordpress/ installation and then have the userblogs as

    mydomain.com/newblog AND newblog.mydomain.com ? point to the same blog?

  11. delayedinsanity
    Member
    Posted 15 years ago #

    That last I would like to see added as a feature. Once again though if you were really persistent I don't see why you could restructure the mod_rewrite rules to allow for that, or at least so as to not break Wordpress, have one send the user to the other.

  12. andrea_r
    Moderator
    Posted 15 years ago #

    Right now, you can't do that in MU, as it would involve far too many rewrites & redirections. At least that's what I think. Given all the sub-blogs are off the main blog, you have to wrangle that redirection for every sub-blog as well, not just the main - because the subs relate to the main. And all that redirection would be pretty impossible on anything but a dedicated server, thus limiting the program's use.

    At least that's why I think why not. Only an opinion. I could most certainly be wrong. :) (it happens)

    Also, as far as I know, nobody has taken the time to come up with a "safe" way to do this, and file a trac ticket with any changes. (ie, do the work to figure it out THEN file a ticket with proposed changes - don't file a ticket to just ask for it)

    And you have to remember WPMU is *server level* software. If you have all kinds of programs stuffed in one domain on one web account, that's just sloppy management.

  13. expat
    Member
    Posted 15 years ago #

    so what do we know is the inner working of MU ? sorry i am new ;)

    1. MU gives option for subdomain or subdirectory

    2. How does it work in subdirectory??

    eg mydomain.com/wordpress/ is the main blog

    do userblogs use the following ?

    mydomain.com/myuserblogs/

  14. andrea_r
    Moderator
    Posted 15 years ago #

    " How does it work in subdirectory??

    eg mydomain.com/wordpress/ is the main blog

    do userblogs use the following ?

    mydomain.com/myuserblogs/ "

    When it asks those options it refers to the user's blogs, not the location of WPMU itself.

    So, for subdomains, it means WPMU is wherever you put it (hopefully the root) and users will be username.yourdomain.com.

    For subfolders or subdirectories (same thing), it means WPMU is install where ever, and user blogs look like they are in a subfolder off of that. yourdomain.com/username.

    If WPMU is installed at mydomain.com/wordpress/, and you pick subdirectories, you'll get mydomain.com/wordpress/myuserblogs/.

    No, there's not really any way around that.

  15. expat
    Member
    Posted 15 years ago #

    why cant you use apache to help this?

    virtual host would surely get rid of the installation folder and leave domain with the username?

  16. andrea_r
    Moderator
    Posted 15 years ago #

    Well, go see what you can come up with and report back then. :)

  17. expat
    Member
    Posted 15 years ago #

    WP should use ONE GLOBAL variable that allow relative links rather than inserting into the DB full direct links

    Are u part of the development team?

  18. delayedinsanity
    Member
    Posted 15 years ago #

    Globals are bad. I don't think that's what you were referring to though, because if you need to change your URL and the only way to do so is by hand editing the Wordpress database, there is only really one entry you have to change in wp_options anyways.

    Oh and no I don't believe she is, she just knows her Wordpress better than most around here.

  19. expat
    Member
    Posted 15 years ago #

    /*$INFO['board_url']			=	'http://mydomain.com';*/
    switch( $_SERVER['HTTP_HOST'] )
    {

    my forums has that "global" board_url variable, which means i can change it easily in one file.

    secondarily, i can do a switch on the http_host and generate as many domain to the one blog as i like LOL

    thats what i mean by one centralised global variable; which means anything that comes out of the DB will be added to $INFO['board_url']

    anyways andrea seems to be the only one helping noobs and getting feed back, they should listen to her ;)

  20. andrea_r
    Moderator
    Posted 15 years ago #

    Nope, not on the dev team. :) Just Donncha is. :D

    I just use WPMU a *LOT*, keep tabs on all the dev, and write http://wpmututorials.com

  21. JustinCasey
    Member
    Posted 14 years ago #

    Hi Andrea,

    I am new to WPMU and before I install it and hope it does what I need it to do I figured I would ask.

    I have a site that my company uses to show boring tax publication info.

    A customer signs up for our service and then receives a subdomain on our site. domain.com/user1. This includes a custom splash page with a company logo or company imprint.

    The splash page has a main menu to about 5 different sections of the site. Once the user clicks on a section they go to domain.com/user1/pages/section1/whateverpage.html.

    Currently we are using a simple static site and if we make any changes to an article I need to take the master "pages" sub-directory and copy it into all of the users sub-directories. Of course, this blows.

    I would like to use WPMU to control all the content for each user with one simple edit to whatever article(s) might need it.

    Am I able to have WPMU work like this? Can I have the same blog or articles show up on multiple sub-directories and can the default page of each sub-directory be customized to each client?

    Thanks in advance!

    Justin

  22. andrea_r
    Moderator
    Posted 14 years ago #

    "Can I have the same blog or articles show up on multiple sub-directories "

    Nope. Not by default.

    " can the default page of each sub-directory be customized to each client?"

    Yes.

  23. JustinCasey
    Member
    Posted 14 years ago #

    Thanks Andrea.

    "Can I have the same blog or articles show up on multiple sub-directories "
    Okay if not by default then how?

    Any plug-ins to do this?

    Also, can I have the subdirectory read as domain.com/user1 instead of user1.domain.com?

    I also checked out your site. I likey.

  24. andrea_r
    Moderator
    Posted 14 years ago #

    "Also, can I have the subdirectory read as domain.com/user1 instead of user1.domain.com?"

    Yes, that was an option on installation. If you have no user blogs, or they are test blogs you can delete, just go into wp-config.php and change the line that says VHOST=yes to no.

    ""Can I have the same blog or articles show up on multiple sub-directories "
    Okay if not by default then how?"

    Things like the BlogDesk client for posting to multiple blog, for example.

    "Currently we are using a simple static site and if we make any changes to an article I need to take the master "pages" sub-directory and copy it into all of the users sub-directories."

    If all you need is the exact same pages to show up on all sub-sites, like a navigation bar, you could do something like this in the template:

    just before the nav bar code put
    <?php switch_to_blog(1); ?>
    right after the navbar code put
    <?php restore_current_blog(); ?>
    then it will always show the pages from Blog #1.

  25. JustinCasey
    Member
    Posted 14 years ago #

    Cool, thanks!

    I will start check it out.

    So the blog menu and articles will all show up in the subdirectory if I use <?php switch_to_blog(1); ?>
    right after the navbar code put
    <?php restore_current_blog(); ?> ?

  26. gazouteast
    Member
    Posted 14 years ago #

    If you're up to coding the php and html directly, you could create a "master pages" directory (e.g. WPMU/wp-content/masterpages) and store the php files for them in there.

    Then using something like the blog defaults plug-in, you set all new blogs to automatically have pages created where the content is a simple function command e.g.
    [masterpage]document-1[/masterpage]

    You then need to write a WP function into the theme or site functions file which basically says (this is NOT correct code - I'm not a programmer) ....


    function.masterpages
    if exists(function.masterpage()){
    $document-name = 'document-name';
    include $BLOG_URL . WP_CONTENT_DIR . "/masterpages/" . $document-name . ".php";
    }

    Then the content from your master document will appear on the page you auto-include for each blog in the blog defaults plugin settings.

    Hopefully a coder will pop along to insert the correct code to run that function? If I had time I could copy and paste from a similar function, but I'm a little pressed right now and actually looking for something completely different to your query.

    Alternatively - a little trickier to manage this and upgrading WPMU WILL lose your custom content (I know because it did it to me a couple of hours ago), you can create the page content direct within the blog defaults plugin's settings page - BUT KEEP A COPY OF THE CONTENT ON YOUR LOCAL PC !!!!

    Gaz

  27. LizFilardi
    Member
    Posted 14 years ago #

    Hi,

    Thanks for this thread. I installed WPMU in a subdirectory (kickstand.tv/wp) and now want to remap the domain to kickstand.tv. but as i see here, I incorrectly assumed that this was possible because that's how I installed WPsingle. Thank you for that clarification. How do I go about moving WPMU to the root? do i have to reinstall?

    thanks,

    liz

About this Topic

  • Started 15 years ago by mercator
  • Latest reply from LizFilardi