View Single Post
Old 11-12-2008, 09:29 AM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,515
i tested it and it works, so dont say it doesnt :p

Code:
Options +FollowSymLinks 
RewriteEngine On 

# force www
RewriteCond %{HTTP_HOST} ^domain\.com$
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

# abc.domain.com/def --> /subs/abc/def 
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] 
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$ [NC] 
RewriteCond %{DOCUMENT_ROOT}/subs/%2%{REQUEST_URI}/ -d 
RewriteRule [^/]$ http://%2.domain.com%{REQUEST_URI}/ [R=301,L] 
RewriteCond %{ENV:REDIRECT_STATUS} ^$ 
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] 
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$ [NC] 
RewriteRule ^(.*)$ /subs/%1/$1 [QSA,L]
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


My Cam Feeds Script / Gallery Scraper / WPXXX Theme / Free Templates
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote