From owner-freebsd-questions Sun Jan 20 3:58:47 2002 Delivered-To: freebsd-questions@freebsd.org Received: from protactinium.btinternet.com (protactinium.btinternet.com [194.73.73.176]) by hub.freebsd.org (Postfix) with ESMTP id 0679137B402 for ; Sun, 20 Jan 2002 03:58:40 -0800 (PST) Received: from host217-35-43-83.in-addr.btopenworld.com ([217.35.43.83] helo=marvin.penguinpowered.org.uk) by protactinium.btinternet.com with esmtp (Exim 3.22 #8) id 16SGcQ-0006Kz-00; Sun, 20 Jan 2002 11:58:38 +0000 Received: from [192.168.10.12] (helo=set.home.penguinpowered.org.uk) by marvin.penguinpowered.org.uk with esmtp (Exim 3.33 #1) id 16SGha-0000BT-00; Sun, 20 Jan 2002 12:03:58 +0000 Received: from waynep by set.home.penguinpowered.org.uk with local (Exim 3.34 #3) id 16SGci-00009l-00; Sun, 20 Jan 2002 11:58:56 +0000 From: Wayne Pascoe To: Trevin Chow Cc: questions@freebsd.org Subject: Re: using mod_rewrite to redirect ports? References: <20020119234506.K50936-100000@benny.geektank.org> Date: 20 Jan 2002 11:58:55 +0000 In-Reply-To: <20020119234506.K50936-100000@benny.geektank.org> Message-ID: Lines: 34 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.5 (bamboo) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Trevin Chow writes: > I'm trying to figure out how to properly setup mod_rewrite on Apache > 1.3.22 to redirect > requests for any sub-domain requests to the same subdomain but on a > different port. > > In other words: > > http://.foo.com ---> > http://.foo.com:8080/ I would guess something like RewriteRule /(.*).foo.com http://$1.foo.com:8080/ \ [redirect=temporary,last] Try that as a start. Also, set RewriteLogLevel to something like 3 and watch what happens at the request stage. TURN THIS OFF BEFORE GOING PRODUCTION! THE LOGS WILL EAT DISK SPACE _FAST_. Sorry, just had to lob that in there :) Lastly, be careful with directing web requests to ports other than 80 or 8080 if you want the world to be able to reach the site. A lot of corporate firewalls these days only allow outgoing requests to certain known ports. HTH -- - Wayne Pascoe | Things fall apart; the centre cannot hold; freebsd@molemanarmy.com | Mere anarchy is loosed upon the world. http://www.molemanarmy.com | - Yeats | To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message