Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C50CA6A02 for ; Thu, 2 Jun 2011 01:20:01 +0000 (UTC) Received: (qmail 9671 invoked by uid 500); 2 Jun 2011 01:19:58 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 9606 invoked by uid 500); 2 Jun 2011 01:19:58 -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: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 9598 invoked by uid 99); 2 Jun 2011 01:19:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jun 2011 01:19:58 +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: local policy) Received: from [83.160.57.126] (HELO xs.adaptr.nl) (83.160.57.126) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jun 2011 01:19:52 +0000 Received: from [10.10.10.88] (unknown [10.10.10.88]) by xs.adaptr.nl (Postfix) with ESMTPSA id 14C611D8020 for ; Thu, 2 Jun 2011 03:19:30 +0200 (CEST) Message-ID: <4DE6E521.9000309@adaptr.nl> Date: Thu, 02 Jun 2011 03:19:29 +0200 From: Jeroen Geilman User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110501 Thunderbird/3.1.10 ThunderBrowse/3.3.5 MIME-Version: 1.0 To: users@httpd.apache.org References: <5D491B03CB024D5D90ACE8FD8DB334FA@rabbithill> In-Reply-To: <5D491B03CB024D5D90ACE8FD8DB334FA@rabbithill> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Special configuration for requests that do not match any particular virtual host? Apache 2.2 On 06/02/2011 01:05 AM, Geoff Millikan wrote: > I want to make a catch-all virtual host (like the manual mentions below) which redirects any errant hostnames like > http://oopsie.mydomain.com/ to our main hostname at http://www.mydomain.com/ But the below example doesn't work - I'm getting an > infinite redirect from http://www.mydomain.com/ right back to http://www.mydomain.com/ > > What am I missing? > > #First virtual host entry > > RewriteEngine On > RewriteRule .* http://www.mydomain.com%{REQUEST_URI} [L,R=301] > ErrorLog /var/log/httpd/error_log > CustomLog /var/log/httpd/access_log combined > NO. nonononono. Get rid of all the rewrite junk and just set a dummy servername; this will catch ALL undefined hostnames. Then Redirect / to the correct vhost. -- J. --------------------------------------------------------------------- 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