httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adi Linden <>
Subject Re: AW: [users@httpd] VirtualHost and Memory Consumption
Date Tue, 20 Jan 2004 19:25:20 GMT
On Tue, 20 Jan 2004, Robert Andersson wrote:
> I tweaked it for your situation, and so might be broken. It would either
> redirect a.b.c to www.a.b.c or www.a.b.c to a.b.c. I think this is good
> strategy, as you don't have more than one name for a site.

Thank you for all the suggestions. This is what I cooked up and tested, a 
combination of what I read in the apache docs and learned here.

  # Bulk rewriting for users virtual hosts
  RewriteEngine On

  # Do some useful logging (optional)
  #RewriteLog /var/log/httpd/rewrite_log
  RewriteLogLevel 0

  RewriteMap   lowercase  int:tolower

  RewriteCond  %{REQUEST_URI}                !^/icons/
  RewriteCond  ${lowercase:%{SERVER_NAME}}   !^www\.sample\.org$
  RewriteCond  ${lowercase:%{SERVER_NAME}}   ^([0-9a-z-]+)\.sample\.org$ [OR]
  RewriteCond  ${lowercase:%{SERVER_NAME}}   ^www\.([0-9a-z-]+)\.sample\.org$
  RewriteRule  ^(.+)                         /home/%1/public_html/$1


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message