httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ja...@aol.com
Subject Re: [Apache] Catchall Subdomain Method?..
Date Fri, 05 Jul 2002 11:28:16 GMT
RewriteCond   %{HTTP_HOST}                 ^www\.[^.]+\.host\.com$
RewriteRule   ^(.+)                        %{HTTP_HOST}$1          [C]
RewriteRule   ^www\.([^.]+)\.host\.com(.*) /home/$1$2

http://httpd.apache.org/docs/misc/rewriteguide.html

See Virtual User Hosts

In a message dated 05/07/02 16:14:30 GMT Daylight Time, 
the_radix@the-spectrum.org writes:

<< Below is an extract of my current .htaccess (main /htdocs dir) file:
 
 
 DirectoryIndex index.php index.php3 index.html index.htm
 
 RewriteEngine On
 Options +FollowSymlinks
 RewriteBase /
 RewriteCond %{HTTP_HOST} a.wwwname.org
 RewriteCond %{REQUEST_URI} !a/
 RewriteRule ^(.*)$ subs/a/$1 [L]
 RewriteCond %{HTTP_HOST} b.wwwname.org
 RewriteCond %{REQUEST_URI} !b/
 RewriteRule ^(.*)$ subs/b/$1 [L]
 RewriteCond %{HTTP_HOST} mysqladmin.wwwname.org
 RewriteCond %{REQUEST_URI} !mysqladmin/
 RewriteRule ^(.*)$ mysqladmin/$1 [L]
 RewriteCond %{HTTP_HOST} uploads.wwwname.org
 RewriteCond %{REQUEST_URI} !uploads/
 RewriteRule ^(.*)$ uploads/$1 [L]
 RewriteCond %{HTTP_HOST} webdev.wwwname.org
 RewriteCond %{REQUEST_URI} !subs/webdev/
 RewriteRule ^(.*)$ subs/webdev/$1 [L]
 RewriteCond %{HTTP_HOST} c.wwwname.org
 RewriteCond %{REQUEST_URI} !subs/webdev/c/
 RewriteRule ^(.*)$ subs/webdev/c/$1 [L]
 
 
 
 (note: I have changed real names for privacy. FYI)
 
 
 Now the thing is as you can see this is getting a little messy..
 
 and if I intend to add many more little handy subdomain's well it will 
become harder to manage..
 
 
 
 I'd just like to know if there is a simpler way of doing this??
 
 
 I have played with RegEx strings for a while with it but it never seems to 
work how I want...
 
 
 Ie.. I have tried using like ([A-Za-z0-9\-]+).wwwname.org and making that 
goto /subs/%1 etc..
 
 didn't really work though..
 
 
  >>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message