Support » Networking WordPress » need help moving from Subdirectory to ROOT, v3.6 multisite, 2 sites

  • Resolved Brazen4

    (@brazen4)


    I’m having trouble sorting out how to select one site out of my two, open via root of my host. I went through a lot of effort to re-create my existing html static home site to WP, after falling in love with Wp after setting up a separate Blog. Now I want to DEL the old site and use my re-created WP version as root. BTW… right now, multisite, permalinks, etc are working like a charm. I’ll try to keep it brief. 😉

    host: radiant-homes.com
    WP subdir: radiant-homes.com/blog/
    site 1: radiant-homes.com/blog/ <– by Wp default (my blog)
    site 2: radiant-homes.com/blog/wp/ <– new site (my static site)
    goal: radiant-homes.com/blog/wp/ to open with radiant-homes.com
    so far: got radiant-homes.com/blog/ to open via radiant-homes.com

    So…. how and where do I tell WP to open the site at radiant-homes.com/blog/wp/ , and not radiant-homes.com/blog/ as it’s doing now? I used the index.php & .htaccess “copy” method to achieve what I have so far. My “Blog” is loading at root…. I want to load the “other” secondary site as root.

    I have not tried bemdesign’s suggestion of modifying my wp-config.php file yet…. was a little frightened it may lock me out, etc. Below is my WP relevant data from .htaccess and index.php copied to ROOT.

    .htaccess (@root)

    RewriteEngine On
    RewriteBase /blog/
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    # BEGIN WordPress
    # <IfModule mod_rewrite.c>
    # RewriteEngine On
    # RewriteBase /blog/
    # RewriteRule ^index\.php$ - [L]
    # RewriteCond %{REQUEST_FILENAME} !-f
    # RewriteCond %{REQUEST_FILENAME} !-d
    # RewriteRule . /blog/index.php [L]
    # </IfModule>
    # END WordPress

    index.php (@ root)

    <?php
    /**
     * Front to the WordPress application. This file doesn't do anything, but loads
     * wp-blog-header.php which does and tells WordPress to load the theme.
     *
     * @package WordPress
     */
    
    /**
     * Tells WordPress to load the WordPress theme and output it.
     *
     * @var bool
     */
    define('WP_USE_THEMES', true);
    
    /** Loads the WordPress Environment and Template */
    require('blog/wp-blog-header.php');

    <— no trailing } in index.php… is this normal/correct?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The lack of ?> in your index.php page is fine.

    Before you set up Multisite, were you giving WP it’s own directory or was everything installed in and running from the /blog/ folder all along?

    Mika,
    “or was everything installed in and running from the /blog/ folder all along?” <— yes! 😉

    I installed WP (in default/single mode) in the /blog/ subfolder of my site’s root dir. WP automatically used radiant-homes.com/blog/ as the default/first site’s root dir, which is fine by me for the blog. I then created the second site (which I wanted to eventually replace my existing main/static html home page) and was forced to choose a directory…. in which I chose /wp/. So the second site created is using radiant-homes.com/blog/wp/ as it’s root access.

    What I want is to use that second site “blog_id=2” (/blog/wp/) as my main site’s root site, and keep the first site “blog_id=1” (/blog/) as is for my separate blog page. I read your one multisite pdf which was wonderful btw…. (thank you!) but I don’t think it addresses what I’m trying to accomplish. maybe multisite wasn’t my best choice for what I want to do? Since posting this question, I have installed another WP in the root of my host, and managed with some effort to recreate the work I’ve done in the /blog/ multisite. You can see it here http://radiant-homes.com. My blog still works, after all the trial-n-error fiddling with the db, .htaccess, and wp-config.php. LOL
    radiant-homes.com/blog/.

    It would be more convenient to keep multisite for many reasons…. I just really wanted to get my main site back up (the new one converted to WP), hence the second WP install. Bear in mind…. before 2 weeks ago I was a total WP newb so this has almost cost me my relationship with all the hours I’ve put into this. Not a good thing but I do own a small contracting biz and this was what I felt an important endeavor.

    Any help would be appreciated… thank you for the response above.
    Jim

    @mika: Just downloaded your “other” pdf you mention to another user…. it’s page 82 btw. Let me try this before you waste time on me. 😉 I’ll report back here with my results and elaborate & close if this works!

    Jim

    Ah, thanks. It was 81 and then I updated it for 3.6 😉

    “or was everything installed in and running from the /blog/ folder all along?” <— yes! 😉

    Moving Multisite to be in /blog but ACT like it’s in / (aka giving WP it’s own directory) is … Well. I’ve never done it. It’s something you really ought to do BEFORE you activate Multisite.

    But that isn’t really what you want. And what you want may not be possible.

    What I want is to use that second site “blog_id=2” (/blog/wp/) as my main site’s root site, and keep the first site “blog_id=1” (/blog/) as is for my separate blog page.

    There are two problems here.

    1) /blog/ is a protected name. If you installed WP in domain.com, as a subfolder install, then the MAIN blog would use domain.com/blog/postname for its posts :/

    2) The only way to get to where / is your domain from here is to actually move WP totally to root. Giving it its own directory AFTER the Multisite fact is so complicated, I don’t actually know anyone who’s tried.

    @mika

    But that isn’t really what you want. And what you want may not be possible.

    Yeah…. everything I’ve tried so far hasn’t gotten me what I want. (either by .htaccess and/or wp-config.php) I have managed to get the second site /blog/wp/ to open via root, but then the main/first site “blog” is corrupt. If I enter http://radiant-homes.com/blog/ as I should, it uses the second site’s theme and produces a blank page… no data/posts.

    Giving it its own directory AFTER the Multisite fact is so complicated, I don’t actually know anyone who’s tried.

    Well now you can say you do! LOL So anyhow….. I’ve given up and went ahead and installed a second WP in root, exported my second site from /blog/wp/ and imported it via the import plugin, copied my theme I created for my main re-creation site, re-uploaded a few necessary pics to the root install, checked all pages, and it’s up and running. MUCH easier than fighting this. I thank you for all the assistance and I will close this thread as resolved, but impractical! 😉

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘need help moving from Subdirectory to ROOT, v3.6 multisite, 2 sites’ is closed to new replies.