View Single Post
Old 05-15-2002, 01:04 AM  
hyper
Confirmed User
 
Join Date: Mar 2002
Location: Mass Ass
Posts: 5,294
#
# In this file, you need only change the value "yourdomain" to match
# your real domain ("whatever\.com", and all "." must be prefixed with a "\")
#
# Then you create the "subdomains" directory in your public_html directory
# and create in that directories named for the subdomain you want:
# http://iwantthis.yourdomain/ would be in /public_html/subdomains/iwantthis/
#
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?yourdomain$ [NC,OR]
RewriteCond %{REQUEST_URI} ^/?subdomains/ [NC]
RewriteRule ^. - [L]
RewriteCond %{HTTP_HOST} ^(www\.)?[^.]+\.yourdomain$ [NC]
RewriteCond %{REQUEST_URI} !^(www\.)?[^.]+\.yourdomain$ [NC]
RewriteRule ^(.+) %{HTTP_HOST}/$1 [NC]
RewriteRule ^(www\.)?([^.]+)\.yourdomain/(.*) /subdomains/$2/$3 [L]
__________________
hyper is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote