.htaccess for 2 CMS in different directories

My site is set up with 2 CMS syatems

In the root domain there is a Joomla website and in another directory called /word/ there is a wordpress directory.

Read More

The site originally was the wordpress site and this was moved to /word/ directory but to maintain all the original url’s, I used mod_rewrite which works great until I insert the mod_rewrite for the Joomla site.

The mod_rewrite works great for the Joomla site but blocks all access to /word/ directory and 404 errors are thrown up. And if I leave the Joomla code out of the .htaccess I am left with the trailing /index.php/page name.

I have in my .htaccess file (This stops access to the /word/directory)

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

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

# END WordPress

How can these 2 live together?

Related posts

Leave a Reply

1 comment

  1. Joomla comes with its own .htaccess template which should be in the root folder and called htaccess.txt. Usually, I would rename to .htaccess and then un-comment this line:

    # RewriteBase /
    

    to:

    RewriteBase /
    

    My suggest would be to replace your “Joomla” section with the one provided by Joomla and see if that does the trick.