6

We are running magento on our site www.xsmoke.com. The site is international, so we are using "/country code" - e.g.www.xsmoke.com/de/ etc.

Now we would like to install wordpress in one of the languages only and we want the URL to be "xsmoke.com/de/blog".

But i can't create a folder on that location for the wordpress files because of magento.. Does anyone have an idea for a workaround?

  • Please accept the answer if it helped you solving your problem. This way the question will no longer be counted as "unanswered" (magento.SE needs a higher rate of answered questions to go out of beta eventually) – Fabian Schmengler Feb 14 '15 at 21:20
  • I would highly discourage to run Magento and WordPress on the same domain. WordPress has known many security issues and this will pose a risk to your Magento webshop too. I always keep every application on it's own (sub) domain. – 7ochem Jun 6 '15 at 9:50
  • @7ochem Is the above comment (of keeping wordpress on a separate domain due to security issues) still valid and required even if create a separate folder outside of magento root and install wordpress in there as fschmengler suggested below ? – Vinu D Jun 25 '16 at 19:04
  • 1
    @VinuD, this is still the case. WordPress (plugins) security is very low and once they have hacked your WordPress, they could probably also hack Magento. Any software package can have security issues, so it is always good practice to keep them all on separate servers. – 7ochem Jun 27 '16 at 9:20
  • @70chem thanks a lot. We are a small site with magento and server root in the same folder. We prefer the subfolder structure but are not able to figure out how to create a subfolder structure on with a separate server i.e. we want our blog to look as www.oursite.com/blog in-spite of blog being on a separate server. Any tips or resource links. Cheers. – Vinu D Jun 27 '16 at 10:10
4

Install Wordpress in a different location, ideally outside of the Magento root and add this rule to the .htaccess file of Magento:

RewriteRule ^/de/blog/(.*) /path/to/wordpress/$1 [QSA]

This way the server redirects requests like /de/blog/anything internally to /path/to/wordpress/anything (Note that the former is a URL, the latter a path on the server)

[QSA] makes sure that any query string like ?page=123 gets appended as well.

| improve this answer | |
  • @fscgmengler this is such a fantastic comment, pity it is not marked as answer. I just have one question, 7ochem sort of confused me by saying that we need to create a separate domain due to security issues. Would we face security issues (due to word press plugins) using this separate folder root outside of magento root ? – Vinu D Jun 25 '16 at 19:08
  • 1
    With my proposed solution, Magento and Wordpress will have to run under the same user, which indeed makes Magento only as secure as your Wordpress installation. Note that using different domains doesn't make it more secure per se, you also have to configure them to use different users and groups. – Fabian Schmengler Jun 27 '16 at 6:26
  • @fscgmengler from a security point of view, what would be a good solution. Are the two equally vulnerable i.e. 1.Put word press inside magento 2. Put word press in parallel to magento. Sorry, we are security noobs and could use any architecture help. Thanks – Vinu D Jun 27 '16 at 6:36
  • What about Nginx? – camdixon Oct 10 '16 at 16:19
-1

This solution worked for me. Now i can access wordpress blog in the magento subdirectory.. Put this code in the wordpress .htaccess file.

# 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
| improve this answer | |
-1

All of these answers are incorrect. Using the FishPig_WordPress module, you can easily and securely integrate WordPress into Magento.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.