I am having an issue trying to set up multiple RewriteBase directories for a production / live environment. I have followed the guidance provided at:
Many RewriteBase in one .htaccess file?
With mod_rewrite can I specify a RewriteBase within a RewriteCond?
This broadly seems to work except when the base directory is the root (i.e. "/") as follows:
RewriteCond %{HTTP_HOST} ^localhost/tla-test/(.)$ [OR]
RewriteCond %{HTTP_HOST} ^192.168.0.200/tla-test/(.)$
RewriteRule ^(.*)$ tla-test/index.php&page=$1 [L]
RewriteCond %{HTTP_HOST} ^test.townshendla.com/(.)$
RewriteRule ^(.*)$ /index.php&page=$1 [L]
#Send any reqests to the index.php file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php
The first rewrite condition works perfectly. The second rewrite condition keeps coming up with an error 500 whenever it kicks in. As it's 1and1 I cant get the Apache error logs but if I try and replicate on a test environment I get the following error (please note this could be unrelated):
AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
Any thoughts would be much appreciated.