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 EADC510D5A for ; Sun, 18 Aug 2013 14:56:21 +0000 (UTC) Received: (qmail 19022 invoked by uid 500); 18 Aug 2013 14:56:19 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 18480 invoked by uid 500); 18 Aug 2013 14:56:14 -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 18464 invoked by uid 99); 18 Aug 2013 14:56:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Aug 2013 14:56:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@lizardhill.com designates 54.218.61.235 as permitted sender) Received: from [54.218.61.235] (HELO lhaws01.lizardhill.com) (54.218.61.235) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Aug 2013 14:56:09 +0000 Received: from ip70-170-115-152.lv.lv.cox.net ([70.170.115.152] helo=Mickey) by lhaws01.lizardhill.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1VB4OR-0003pQ-60 for users@httpd.apache.org; Sun, 18 Aug 2013 07:55:47 -0700 From: "Don O'Neil" To: References: <004501ce9b5e$5a7d8650$0f7892f0$@lizardhill.com> In-Reply-To: <004501ce9b5e$5a7d8650$0f7892f0$@lizardhill.com> Date: Sun, 18 Aug 2013 07:55:36 -0700 Message-ID: <002701ce9c23$00052a50$000f7ef0$@lizardhill.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQKWdLJL/apB71IQN5XZQ+Scc9pQxJgLXBcA Content-Language: en-us X-Antivirus: avast! (VPS 130818-0, 08/18/2013), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org Subject: RE: [users@httpd] Strange httpd 2.4.6 Mod_Rewrite issue Ok... here's some more detail on the issue.... The particular VHOST config has 3 aliases... and when there are rewrite rules for just one alias it seems to work fine... but as soon as there are 3, and in a particular order I might add, then it breaks... and you get the error I posted on the last rewrite rule, and error 500's on the other 2.... when I moved around the order (a simple yank/put in VIM) then it started working. Seems like I might have uncovered a bug here in the mod_rewrite module. -----Original Message----- From: Don O'Neil [mailto:lists@lizardhill.com] Sent: Saturday, August 17, 2013 8:28 AM To: users@httpd.apache.org Subject: [users@httpd] Strange httpd 2.4.6 Mod_Rewrite issue I'm having a very strange issue with the mod_rewrite module. First off here's the basics: Apache 2.4.6, Centos 6 x64 Here's the loading of the directive: RewriteEngine on RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] LogLevel alert rewrite:trace1 The newdomain.com (example!!) address is set up as an alias on the main vhost, and here's the rewrite in the .htaccess at the top level: RewriteCond %{HTTP_HOST} ^((.+)\.newdomain|newdomain)\.com$ RewriteCond %{REQUEST_URI} !^(/cgi-bin/(.+)|/ newdomain |/ newdomain /(.*))$ RewriteRule ^(.*) newdomain /$1 [L] This used to work on my old Apache 1.X box, but now it doesn't work on the new one. when you go to the the alias, you get an error: The requested URL /newdomain/index.htm was not found on this server. Now it is true that there isn't an index.htm file in there, but there is an index.shtml file... I've also tried it with an index.html file, index.php, and even a symlink, but in all instances I get the same error. It's like the DirectoryIndex command is being ingnored: DirectoryIndex index.html index.htm index.shtml index.php index.php5 index.php4 index.php3 index.phtml index.cgi Any ideas why the rewrite isn't working right? The purpose is to redirect the request to newdomain.com to a subdirectory and rewrite the URL so it looks like it's going to the root of that directory rather than the subdir of the parent domain. The log shows it redirecting successfully, and I've checked all the perms/owner: [Sat Aug 17 08:15:17.607554 2013] [rewrite:trace1] [pid 10092] mod_rewrite.c(468): [client X.X.X.X:51466] X.X.X.X - - [www.newdomain.com/sid#1049ac0][rid#1c6f1b0/initial] [perdir /home/newuser/domains/topdomain.com/public_html/] internal redirect with /newdomain/ [INTERNAL REDIRECT] But it just doesn't load index.shtml or index.php Any assistance would be appreciated! --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org