Virtual hosting
- by H3llGhost
Hello,
I want to use domains like xxx.abc.domain.tld.
The xxx is my folder to access. I tried it with the rewrite rules, but I can't get it working, because I don't know how to get the part xxx from the SERVER_NAME into my RewriteRule.
This was my try:
UseCanonicalName Off
# include the IP address in the logs so they may be split
LogFormat "%A %h %l %u %t \"%r\" %s %b" vcommon
CustomLog /var/log/apache2/vaccess.log vcommon
RewriteEngine On
# a ServerName derived from a Host: header may be any case at all
RewriteMap lowercase int:tolower
## deal with normal documents first:
# do the magic
RewriteCond ${lowercase:%{SERVER_NAME}} ^.+\.abc\.domain\.tld$
RewriteRule ^(.*)$ /var/www/abc.domain.tld/[xxx-part]/$1 [L]
Perhaps there is a better solution.
In generally I want to create a dynamic login system with mod_auth_mysql and for each xxx is a seperate user database.
I would prefer the domain/address syntax abc.domain.tld/xxx, but I don't know how to realize it.
Thanks for any advices.