httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Zimmerman <tar...@spamcop.net>
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. host.com -  is used as the directory, and Tux answers for 
both www.host.com and host.com automagically.

The above rewrite works fine for host.com, but when www.host.com 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 www.host.com and host.com are 
actually the same directory...let alone how to make a symlink).

Thanks,

Mike


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message