Forums

Installing 2nd wordpress blog in sub directory of first... mod_rewrite? (5 posts)

  1. dmiyares
    Member
    Posted 1 year ago #

    Hello:

    First off if this topic has been covered before I apologize. I searched around but haven't found the exact setup I'm trying to do. Anyhow... I'm running a WordPress 2.9.2 site and want to install a second version with totally different theme & plugins below that to act as a directory. So our main WP site is at http://www.example.com I would like to install the second one to run in http://www.example.com/directory not directory.example.com... anyhow once installed I can get to the main index page in directory but any sub pages are redirected via mod_rewrite to the main site. How can I tell mod_rewrite that anything heading into /directory/ should be handled by the 2nd install?

    Thanks in advance.

  2. ninenote
    Member
    Posted 1 year ago #

    Try login to http://www.example.com/directory/wp-admin

    Then go to Setting -> General
    Double check if the url is http://www.example.com/directory/ (for both)

    Then go to Setting -> permalink
    Click save setting even you change the value or not, WordPress will automatically update .htaccess for you.

    If this not work, please post your .htaccess in sub directory here

  3. dmiyares
    Member
    Posted 1 year ago #

    Hi Ninenote:

    Did that for the directory install but didn't work. Pages like example.com/directory/business/widgets come up as 404 on the main site :(

    Below is the .htaccess file for the directory. For the main website (also WP) just remove the directory/ in rewritebase.

    Is there a way to mix both? I can also use the apache setup files since I have access to them.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /directory/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /directory/index.php [L]
    </IfModule>

  4. ninenote
    Member
    Posted 1 year ago #

    In .htaccess of main website,
    Can you try put this line

    RewriteCond %{REQUEST_URI} !^/directory/

    immediately after

    RewriteCond %{REQUEST_FILENAME} !-d

    Not sure will this work or not, we tell first .htaccess to ignore any requests to that directory. Then the second one can do the job.

  5. dmiyares
    Member
    Posted 1 year ago #

    Hi Ninenote:

    Tried that and that didn't work... I revisited my initial setup for this Apache instance and changed the allow overides to use the .htaccess files. Now it works perfectly out of the box :)

    Thanks for your help

Topic Closed

This topic has been closed to new replies.

About this Topic