View Single Post
Old 10-16-2006, 12:08 PM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,480
sub folder, if you want to do sub domains on the fly their is a cool trick.

edit your domain zone file

add

* IN A domainip

then you could use .htaccess to create them based on the sub domain

Options +FollowSymLinks

RewriteEngine On

# mod_dir fix
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]

# strip sub subdomains
RewriteCond %{HTTP_HOST} ^.*\.([^\.]+\.domain\.com)$ [NC]
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,L]

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


My Cam Feeds Script
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote