Subdomain rewrite problem when redirect path exists on server's local filesystem
When entering a subdomain (for example "dev") with a redirect path "/dev/" the following is written into the Apache vhost file:
RewriteCond %{HTTP_HOST} ^dev.domain.de [NC] RewriteRule ^/(.*)$ /dev/$1 [R,L]
If the redirect path does not exist on the local filesystem of the server, it works. In this case, it does not, because Apache actually seems to try to access /dev/ on the local filesystem.
So in my understanding the following
RewriteCond %{HTTP_HOST} ^dev.domain.de [NC] RewriteRule ^/(.*)$ var/www/clients/client1/web1/web/dev/$1 [R,L]
or
RewriteCond %{HTTP_HOST} ^dev.domain.de [NC] RewriteRule ^/(.*)$ var/www/domain.de/web/dev/$1 [R,L]
should be entered in the vhost file. This works 100%.
Edited by Thom