Redirect Traffic
I want to redirect traffic in this way.
kevin.domain.com -> /var/www/kevin/domain.com/
thomas.example.com -> /var/www/thomas/domain.com/
kevin.subdomain.domain.com -> /var/www/kevin/subdomain.domain.com/
$user.$subdomain-and-domain -> /var/www/$user/$subdomain-and-domain/
But if the first part isn't a user (that means, the dir /var/www/$user/
doesn't exist), it must redirect in this way:
domain.com -> /var/www/working/domain.com/
subdomain.example.nl -> /var/www/working/subdomain.example.nl/
$domain -&开发者_JS百科gt; /var/www/working/$domain/
How can I archieve this?
Many thanks :D!
You can do it by configuring your virtual host, or using mod_rewrite.
Take a look here : http://httpd.apache.org/docs/2.0/vhosts/mass.html
Both methods are explained. Come back if you have any trouble implementing it.
Maybe mod_userdir is interesting.
精彩评论