I'm going nuts here. Apache is completely ignoring both the RewriteCond
and RewriteRule
. I would expect this to error out as RewriteEngine has not been set to On
. I had a bunch of other RewriteCond
and RewriteRule
lines that were working fine and when I checked the Rewrite log (I had enabled) it showed these two being skipped. I trimmed everything else to verify none of it was causing the issue, and sure enough, Apache happily proceeds nary an error with this configuration:
DocumentRoot /var/sites/public
<Directory /var/sites/public>
AllowOverride None
SetEnv APPLICATION_ENV production
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://www.example.com/$1 [L,R]
Order allow,deny
allow from all
</Directory>
I'm pretty sure that there is some glaring error here that I've blinded myself to by staring at it for too long. Any help would be appreciated.
Notes: I don't have this in a Vhost. There aren't any Vhosts in the config. I've removed the RewriteCond and it still doesn't throw any errors. I have tried this with RewriteEngine On as well.