Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C83FB9752 for ; Mon, 26 Dec 2011 11:59:36 +0000 (UTC) Received: (qmail 24010 invoked by uid 500); 26 Dec 2011 11:59:30 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 23849 invoked by uid 500); 26 Dec 2011 11:59:29 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 23841 invoked by uid 99); 26 Dec 2011 11:59:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Dec 2011 11:59:29 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of i.galic@brainsware.org designates 188.40.115.121 as permitted sender) Received: from [188.40.115.121] (HELO mail.brainsware.org) (188.40.115.121) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Dec 2011 11:59:23 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.brainsware.org (Postfix) with ESMTP id 7DFAE6C001 for ; Mon, 26 Dec 2011 11:59:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at brainsware.org Received: from mail.brainsware.org ([127.0.0.1]) by localhost (mail.brainsware.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bN+aLI-H0qNa for ; Mon, 26 Dec 2011 11:58:58 +0000 (UTC) Received: from mail.brainsware.org (mail.brainsware.org [188.40.115.121]) by mail.brainsware.org (Postfix) with ESMTP id 59D8E1DE8B5 for ; Mon, 26 Dec 2011 11:58:58 +0000 (UTC) Date: Mon, 26 Dec 2011 11:58:58 -0000 (UTC) From: Igor =?utf-8?Q?Gali=C4=87?= To: dev@httpd.apache.org Subject: Re: questions about rewrite module Message-ID: <393350a3-a65a-40b1-978d-da773bcda2ae@iris> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Originating-IP: [91.130.91.63] X-Mailer: Zimbra 7.0.0_GA_3077 (ZimbraWebClient - SAF3 (Linux)/7.0.0_GA_3077) X-Virus-Checked: Checked by ClamAV on apache.org ----- Original Message ----- > hi, Hi, Questions about how to *use* mod_rewrite -- or any module -- are best asked on users@ > I encountered a problem while configured virtual host. My experiment > environment is Apache2+fastcgi+php-cgi. > > > I want to implement mass virtual hosting using rewrite rules based on > apache rewrite module. That is, for a request url like: > http://1000.xyz.com/test.php , apache will translate it to a > absolute file path like: $DOCUMENT_ROOT/1000/test.php, and then get > this script to execute. Have you considered using something like mod_vhost_alias? http://httpd.apache.org/docs/current/mod/mod_vhost_alias.html http://wiki.apache.org/httpd/VirtualHostAlias > And my conf is: > > RewriteEngine On > RewriteCond "%{HTTP_HOST}" "!^ www.xyz.com " > RewriteCond "%{HTTP_HOST}" "^([^.]+)\.xyz\.com" [NC] > RewriteRule "(.*)" "/%1$1" [PT] > > I use inner redirection in order not to expose this detail to users. > Besides, I succeeded when I use external redirection, namely the [R] > tag instead of [PT] tag. > When I use [PT] tag, apache cannot run expectedly. I request a url : > http://1000.xyz.com/test.php , error message pops out like: The > requested URL /1000/cgi-bin/php.fcgi/1000/test.php was not found on > this server. > > > I don't know if this error results from fastcgi, is it the > inappropriate config in fastcgi or inevitable problem by using it? > > > Really appreciate your help. > > > Vic > > -- > Best regards, > > Rui Hu > -------------------------------------------------------------------------= --------------- > State Key Laboratory of Networking & Switching Technology > Beijing University of Posts and Telecommunications(BUPT) > MSN: tchrbupt@gmail.com > -------------------------------------------------------------------------= ---------------- > > > -- Igor Gali=C4=87 Tel: +43 (0) 664 886 22 883 Mail: i.galic@brainsware.org URL: http://brainsware.org/ GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE