I have a website in place in one directory (say /var/www/website) which handles multiple domains and aliases.
For example, it handles
www.example.com
www.example.net
www.example.org/front
On a server, it does this for about 80 sites.
The problem is that if a virtual host has an Alias to my website (say www.example.org/front) and the DocumentRoot is set to something else then /var/www/website (like /var/www/static_content) RewriteRules will not work anymore (because it wil look in /var/www/static_content instead of /var/www/website).
Normally a "RewriteBase /front" should fix this, but then I'd break the websites which do not have a "Alias /front /var/www/website" in place.
A "RewriteBase /" is also not working if the site has only Aliasses pointing to /var/www/website.
Is there any way on setting this dynamicly of finding out which Alias was used, so we can do a "RewriteBase /%{alias}" or something?
From an old post, I already have this
# Only do the rewriting if rewriting is enabled
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# Make sure it starts with home. - means do nothing (carry on to the next rules)
# E=BASE:%1 sets the %{ENV:BASE} variable to the bit before home/
RewriteRule ^home(/.*)?$ - [NC,E=BASE:%1]
</IfModule>
A bit is snipped out, but couldn't it be possible to use the ENV:BASE variable for RewriteBase (like "RewriteBase %{ENV:BASE}")? Hint: this line doesn't work... (gives a "Internal Server Error - RewriteBase: argument is not a valid URL)
Any help is appreciated!