.htaccess to auto create sudomains

Discussion in 'Apache' started by pachel, Nov 18, 2009.

  1. #1
    ServerAlias *.domain.com
    Options +FollowSymLinks
    Options +Indexes
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^([^.]+).domain.com$
    RewriteCond %{HTTP_HOST} !^(www|includes|images| )$
    RewriteCond http://www.domain.com/gebruikers/$1 -d
    RewriteCond %{REQUEST_FILENAME} !^http://www.domain.com/gebruikers/
    RewriteRule ^(.*)$ /gebruikers/$1 [L]

    This is a try to make all directorys in gebruikers a subdomain but it doesn't work.
    and when the directory doesn't excist the homepage can someone help?
     
    pachel, Nov 18, 2009 IP