Close

January 13, 2016

Magento Multiple Stores with Seperate WordPress Instances

We’ve started to bring another store online recently that was to be added to an existing Magento hosted store. The existing store already had a blog setup and running with the store under a specific sub-directory. The challenge was the we wanted to bring online a new blog instance that was completely separate from the existing store, but not clutter up our root structure.
The solutions was a bit of HTACESS hacker and domain name management.

First step was to create the folder structure that would host both the old and new stores. The main blog had existed under /www/blog, but we wanted to allow for a better named actual server file structure. We had looked into the “network” version of our blog software (WordPress), but it did not allow us the ability to serve the domain names with the exact same sub-directory structure. Having the blog software in its individual folder also would allow for future easy spin off of the entire store if it was purchased.

So we created
/www/blogsoft
moved the existing blog underneath and created a new folder for the new blog.

We then built an htaccess ruleset to be able to serve the blog software depending on what domain name you requested.
The final step was to blog access directly to our “blogsoft” folder, once the new blog was setup.

The resulting setup allows us to setup an infinitely configurable blog (their own “island” for marketing), while only having to add two lines to an htaccess file to get it to work.

##### BLOG REDIRECTS **************
#prevent access to blogsoft itself.  TURN THIS OFF IF YOU ARE INSTALLING A NEW BLOG
RewriteRule ^blogsoft/?$ $1/blog$2 [R=301,L]

RewriteCond %{HTTP_HOST} www\.domain\.com$ [NC]
RewriteRule ^/?blog(.*)$ /blogsoft/domaincom/$1 [L]

RewriteCond %{HTTP_HOST} www\.anotherdomain\.com$ [NC]
RewriteRule ^/?blog(.*)$ /blogsoft/anotherdomain\/$1 [L]

##### EOF BLOG REDIRECTS **************



Contact Us for any Magento or blog (WordPress) related consultations.