I have a .htaccess in root directory, with this content:
<IfModule mod_rewrite.c>
RewriteEngine on
#RewriteCond %{HTTP_HOST} ^domain.com
#RewriteRule (.*) http://www.domain.com$1 [R=301,L]
</IfModule>
If I go to http://domain.com/subdir it rewrites to http://www.domain.com/subdir.
But I have a problem with one subdirectory named "crm" - if I go to http://domain.com/crm it redirects me to http://www.domain.com instead of http://www.domain.com/crm.
In this "crm" subdirectory I have another .htaccess file, which rewrites .php extension to .html. Here is the code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^([^/]*)/([^/]*)\.html$ ?name=$1&id=$2 [L]
RewriteRule ^(.*).html$ index.php?name=$1 [QSA]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteRule ^([^/]*)/([^/]*)\.html$ ?name=$1&id=$2 [L]
</IfModule>
Can someone please tell me how can I make this work? So when I will go to http://domain.com/crm it will redirect me to http://www.domain.com/crm.
EDIT:
Root .htaccess was ok, I was changing something and forgot to remove comments for stackoverflow.
crm/.htaccess is now:
RewriteEngine on
RewriteOptions Inherit
RewriteRule ^([^/]*)/([^/]*)\.html$ ?name=$1&id=$2 [L]
RewriteRule ^(.*).html$ index.php?name=$1 [QSA]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteRule ^([^/]*)/([^/]*)\.html$ ?name=$1&id=$2 [L]
But it still doesn't redirect this subdir to www.domain.com/crm but only to www.domain.com :(