Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mcc3d.com$ [NC]
RewriteRule ^(.*)$ http://www.mcc3d.com/$1 [R,L]
Except...
...when I have another .htacess file, in a sub-directory. In this case, the top-level one is ignored in favor of the one in the sub-directory (which also uses mod_rewrite). This sub-directory holds a MediaWiki, and uses the following rule:
Code: Select all
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?title=$1 [PT,QSA,L]
However, when I start trying to add the first mod_rewrite chunk to the second .htaccess file, it stops behaving as one might expect. The combined code I "expect" to work is:
Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mcc3d.com$ [NC]
RewriteRule ^(.*)$ http://www.mcc3d.com/$1 [PT,R,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?title=$1 [PT,QSA,L]