Checking if file exist with RewriteCond in a chained RewriteRule
- by gelilloabad
Hello, I hope you could help me here.
I have a RewriteRule which gives you a crossdomain.xml file depending on the domain name. I have it in a way that ignores the ".dev." string in the middle, example:
Request: http://site1.dev.mydomain.com/crossdomain.xml
Returns file: /etc/httpd/conf/crossdomain/site.mydomain.com.xml
RewriteCond %{HTTP_HOST} "^(.*)\.dev\.(.*)"
RewriteCond %{REQUEST_URI} "/crossdomain.xml"
enter code hereRewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^(.*)\.dev\.([^/]*)/crossdomain.xml /etc/httpd/conf/crossdomain/$1.$2.xml [L]
Question: How do I check if the file exists? I tried adding this on top but it doesn't work:
RewriteCond /etc/httpd/conf/crossdomain/$1.$2.xml -f
I guess because it is a chained rule, no idea. Please help.