Search code examples
.htaccessmagentojoomla

Combine a .htaccess for Joomla and Magento


In the root of my website I built a site with Joomla. In the subfolder \webshop\ I build a site with Magento.

I can’t get my .htaccess file right for this. For now the Joomla site works well, and the Magento site also. But I can’t click on for example \Contact us\ in Magento. The link (http://example.com/webshop/contacts) leads me back to the homepage. But when I edit the link to (http://example.com/webshop/index.php/contacts) it works perfectly. So there is something wrong.

For clarity, when people go to http://example.nl, they should go to my Joomla site, but when people go to http://example.nl/webshop, they should go to my webshop. (/webshop is also the location of the Magento folder in my root, of course)

I also want to use http://example.com and not http://www.example.com. (Also very important for SSL in Magento, because I have only a SSL certificate for http:// and not for http://www.)

I found out that when I use Rewrite base /webshop in the .htaccess, it works perfect, but then the Joomla site doesn't work. I combined the Magento .htaccess with my own. I had to upload it with pastebin, because this site doesn't allow links and WWW. What I've done wrong there?

Pastebin


Solution

  • You have Magento installed into the subdirectory named webshop

    In the Magento configuration, you must change the Base URL to include your subdirectory.

    1. Go to System > Configuration > Web

    2. Change Base URL to http://yoursite.com/webshop/ (also update your Secure Base URL)

    3. Open your Magento .htaccess file in your webshop directory and change the following:

      Find: #RewriteBase /magento/

      Change to: RewriteBase /webshop/

    4. Save your Magento .htaccess file & flush your Magento cache folders var/cache