Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 20617 invoked from network); 13 Jan 2004 16:36:03 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 13 Jan 2004 16:36:03 -0000 Received: (qmail 53439 invoked by uid 500); 13 Jan 2004 16:35:42 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 53425 invoked by uid 500); 13 Jan 2004 16:35:42 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 53412 invoked from network); 13 Jan 2004 16:35:42 -0000 Received: from unknown (HELO sphere.barak.net.il) (212.150.48.98) by daedalus.apache.org with SMTP; 13 Jan 2004 16:35:42 -0000 Received: from kavado.com ([62.90.210.230]) by sphere.barak.net.il (InterMail vK.4.04.00.00 201-232-137 license e5bc39f1001e7dfa47fa92d56cd12779) with ESMTP id <20040113163413.EJJQ1667.sphere@kavado.com>; Tue, 13 Jan 2004 18:34:13 +0200 Message-ID: <40042BDC.2040505@kavado.com> Date: Tue, 13 Jan 2004 19:33:16 +0200 From: Yakov Lerner User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@httpd.apache.org, neil.freeman@asa.co.uk References: <40041C21.5090501@asa.co.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: Re: [users@httpd] RewriteRule for subdomains (newbie) X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Neil Freeman wrote: > ...I would like to take a URL in the form: > > http://machine/site_name/ > > and have it rewritten to: > > http://site_name.machine > > I have set up the appropriate VirtualHost for http://site_name.machine > and this works fine, it's just creating the appropriate RewriteRule > that's causing me a problem. How about this (untested) : RewriteRule /([^/]*)/ http://$1.%{REMOTE_HOST} [P] Regarding the [P] flag: leave it out if you need redirection, not proxying -- Jacob Lerner --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org