Running two WordPress installations under one domain

I had the need to maintain two WordPress sites under one domain.  Originally I decided to just have them run in two sub-domains like

  • site1.mysite.com
  • site2.mysite.com

Later it was requested that the two sites to be run under the same domain like

Here are some notes on how that was done.

  1. install two WordPress installations in directories: <home>/www and <home>/www/site2
  2. in the /www/site2/.htaccess, you will change the rewrite rules to

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

  3. in addition(assume the old site2.mysite.com is mapped to  <home>/www/oldsite2), add a redirect rule to redirect traffic to old sub-domain.

    RewriteCond %{HTTP_HOST} ^site2\.mysite\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.site2\.mysite\.com$
    RewriteRule ^(.*)$ “http\:\/\/www\.mysite\.com\/site2$1” [R=301,L]

 

 

 



Leave a comment