mod_rewrite: check if isn't a certain domain
- by weingage
I'm migrating some code from a working web app, but can't get it to work on the new server. Everything seems to be configured correctly, but I'm getting internal redirect limit errors in Apache2. Here are my rewrites and explanation
This WORKS - any subdomains that aren't cdn. or manage. should be redirected to u.php
RewriteCond %{HTTP_HOST} ^(^.*)\.mediasprk\.com$ [NC]
RewriteCond ^(.*)$ !^(cdn|manage)$
RewriteCond %{REQUEST_URI} !\.(png|gif|jpg)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ u.php?uri=$1&hostName=%{HTTP_HOST}
This is no longer working. Goal here is to handle CName pointing. So if it's not my app domain (mediasprk.com), then handle it by sending it to u.php.
RewriteCond %{HTTP_HOST} !^mediasprk\.com$ [NC]
RewriteCond %{REQUEST_URI) !\.(png|gif|jpg)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ u.php?uri=$1&hostName=%{HTTP_HOST}
Can anyone see the issue here in the second block that would cause the redirect limit errors? Maybe something wrong in the rewrites? Thanks.