When requesting a file via the "www" subdomain it should just deliver it.
When requesting a file via the "beta" subdomain it should check to see if the file exists at "/~beta/", and use that if it exists. Otherwise it should serve the same file as if it had been accessed via "www".
This must be done in such a way that if "beta.domain.net/path/file.html" exists (meaning "www.domain.net/~beta/path/file.html" exists) but a css file requested via relative paths used by that html file, does not exist, then it defaults back to the "www" version.
I can point the subdomain anywhere you want me to, speak I can point it at "/~beta/" if you that makes more sense.
Now my first crack at this looked like this:
- Code: Select all
RewriteBase /
RewriteCond %{HTTP_HOST} ^beta.* # if on beta
RewriteCond /~beta%{REQUEST_FILENAME} -s # andif file exists in beta dir
RewriteRule ^(.*) /~beta$1 # rewrite!
or
- Code: Select all
RewriteBase /
RewriteCond %{HTTP_HOST} ^beta.* # if on beta
RewriteRule ^(.*) /~beta$1 # rewrite!
RewriteCond %{REQUEST_FILENAME} !-s # if file does not exist
RewriteRule ^/~beta(.*) $1 # rewrite back
neither works at all. Please help me!
Thank you very much!