httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Zimmerman <>
Subject Rewrite rule trouble
Date Fri, 18 Jan 2002 06:42:19 GMT
Good evening,

	I'm attempting to create a ruleset that will take care of a problem I'm 
having between Tux and Apache. Without going into detail there (its been 
painful enough), here is what I'm
trying to make happen:

In order for me to properly route my passed requests from Tux to Apache, I 
have to look at the HTTP_HOST variable as follows:

RewriteMap  lowercase  int:tolower
RewriteRule  ^/(.*)$  /var/www/html/${lowercase:%{HTTP_HOST}}/$1

Our directories are created in the Tux virtual hosting fashion, where the 
domain - e.g. -  is used as the directory, and Tux answers for 
both and automagically.

The above rewrite works fine for, but when is called, 
the HTTP_HOST doesn't match up and the directory returned in the rewrite 
doesn't exist. I can't seem to figure out how to strip the www. off of the 
HTTP_HOST if it exists in order to match things up properly, even after 
reading through the rewrite user guides I've found.

I would greatly appreciate any help anyone can provide. My stopgap right 
now is symlinks, but that is an ugly hack (can't seem to explain the idea 
to the people that upload the files that and are 
actually the same directory...let alone how to make a symlink).



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

View raw message