Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 26846 invoked from network); 29 Jun 2010 21:54:02 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Jun 2010 21:54:02 -0000 Received: (qmail 61765 invoked by uid 500); 29 Jun 2010 21:53:58 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 61727 invoked by uid 500); 29 Jun 2010 21:53: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 61719 invoked by uid 99); 29 Jun 2010 21:53:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jun 2010 21:53:57 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of apache@foxfilter.foxpaws.net designates 96.10.18.2 as permitted sender) Received: from [96.10.18.2] (HELO vixen.foxpaws.net) (96.10.18.2) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jun 2010 21:53:50 +0000 Received: from FOXBIRD.foxpaws.net (foxbird.foxpaws.net [10.0.0.10]) (authenticated bits=0) by vixen.foxpaws.net (8.13.6/8.13.6) with ESMTP id o5TLrQ68018171 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 29 Jun 2010 17:53:26 -0400 X-DomainKeys: Sendmail DomainKeys Filter v1.0.2 vixen.foxpaws.net o5TLrQ68018171 DomainKey-Signature: a=rsa-sha1; s=vixen; d=foxpaws.net; c=simple; q=dns; h=x-dkim:dkim-signature:x-mailer:date:to:from:subject: in-reply-to:references:mime-version:content-type:x-greylist; b=JKW3BmtUfauiRKy/4qQk6ejPnr5ezp4SAiJBHJiCP0DiwX4L3fsJHkqSK+HVkis54 jucNG/282Inr0l4Fn6q+4NgzAUMyVrqKLnZD0nmlZDMutKXn5xedt5dQF7oHwo/9zyC ZUf+4CEc+1AGsXjfIhFCRtCa/Mb7kUeYk7v8jrY= X-DKIM: Sendmail DKIM Filter v2.8.3 vixen.foxpaws.net o5TLrQ68018171 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=foxpaws.net; s=vixen; t=1277848406; i=@foxpaws.net; bh=7bfsAPwl8P4+NHOnMH7ZN/c9mVyly+3SbsmeHOfpdXw=; h=Date:To:From:Subject:In-Reply-To:References:Mime-Version: Content-Type; b=kGw7TzsihtDc3J7ihkPuftImKrg/VfmJdk0fBQ8aI6w5/Vm/+i3/h4LNhe6kDp+M/ Ta/SHHeMXYoXZzvqsQXWfNsfZdfRqC7Po9g1mAHYr2cOUkR4RyJEySs9CZW9K3Q+oN 6Q19xz7tVk1stp3zz4gZVbIrosPyhrTkz9w+GXMM= Message-Id: <201006292153.o5TLrQ68018171@vixen.foxpaws.net> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Tue, 29 Jun 2010 17:53:01 -0400 To: users@httpd.apache.org From: Greg Neujahr In-Reply-To: References: <201006292007.o5TK76Ck014915@vixen.foxpaws.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (vixen.foxpaws.net [10.0.0.2]); Tue, 29 Jun 2010 17:53:26 -0400 (EDT) X-Virus-Checked: Checked by ClamAV on apache.org Subject: [users@httpd] RewriteRule failing when changing content-handlers Hey Eric, Thanks for the quick reply and hopefully a step in the right direction. I tested it on my linux box as well, and it's apparently a common thing between the two of 'em, so whatever it is I'm doing (if it's supposed to work) is something I've made a habbit of doing. I'd like to fix that. At your suggestion, I removed the AddType lines and replaced them with some recommendations I found via a google search. The new bit in the httpd.conf file is: PHPIniDir "d:/php" AddType text/html .php .phps AddHandler application/x-httpd-php .php AddHandler application/x-httpd-php-source .phps I've also tried it without the enclosed AddType part you see above, but the problem seems to still persist whether or not it's present. I also fiddled a bit using the directive (as suggested by the PHP install pages) and it still exhibited the same problem. mod_cgi was enabled, but I disabled that and the problem still happens. I also tried disabling script-alias lines, in the off-chance they had some special functionality that was taking control of the process. I looked through the list of enabled modules and didn't find anything that seemed like it would be an issue, and nothing else you mentioned was enabled at the time. Out of curiosity, any idea why this would work in a VirtualHost container but not in the per-dir .htaccess file? My only problem with this arrangement is that I'd need to restart apache when I make changes at that high of a level. Dropping in a .htaccess file is much more preferable. Also, just to eliminate PHP as a potential issue here, I tried using a rewrite rule to change any file with the .bogus extension to .html, and then set the handler to text/html (or text/plain). I even moved the .htaccess and the test.html file into the root web directory, just in case there was some issue. The .htaccess file was: RewriteEngine On RewriteRule (.*)\.bogus $1.html [H=text/html] The error log spilled out the following: [Tue Jun 29 17:35:31 2010] [error] [client 127.0.0.1] File does not exist: redirect:/test.html If I remove the [H=text/html] part from the rule, it reads the file just fine. At least here, the error message seems a little more informative. Looks like it can't locate the file for some reason. I'm sure the file test.html is in there, so I'm not sure precisely what file it's trying to locate. Here's a copy of the rewrite.log when it fails and then when it works (without the handler rewrite). It does seem that when it fails there are no entries for the internal redirect and when it works, there are entries that indicate it's being processed further. Fails ----- 127.0.0.1 - - [29/Jun/2010:17:35:31 --0400] [dev.domain.com/sid#176bb40][rid#17841a0/initial] (3) [perdir E:/cyg/wwwroot/] strip per-dir prefix: E:/cyg/wwwroot/test.bogus -> test.bogus 127.0.0.1 - - [29/Jun/2010:17:35:31 --0400] [dev.domain.com/sid#176bb40][rid#17841a0/initial] (3) [perdir E:/cyg/wwwroot/] applying pattern '(.*\.php)s$' to uri 'test.bogus' 127.0.0.1 - - [29/Jun/2010:17:35:31 --0400] [dev.domain.com/sid#176bb40][rid#17841a0/initial] (3) [perdir E:/cyg/wwwroot/] strip per-dir prefix: E:/cyg/wwwroot/test.bogus -> test.bogus 127.0.0.1 - - [29/Jun/2010:17:35:31 --0400] [dev.domain.com/sid#176bb40][rid#17841a0/initial] (3) [perdir E:/cyg/wwwroot/] applying pattern '(.*)\.bogus' to uri 'test.bogus' 127.0.0.1 - - [29/Jun/2010:17:35:31 --0400] [dev.domain.com/sid#176bb40][rid#17841a0/initial] (2) [perdir E:/cyg/wwwroot/] rewrite 'test.bogus' -> 'test.html' 127.0.0.1 - - [29/Jun/2010:17:35:31 --0400] [dev.domain.com/sid#176bb40][rid#17841a0/initial] (3) [perdir E:/cyg/wwwroot/] add per-dir prefix: test.html -> E:/cyg/wwwroot/test.html 127.0.0.1 - - [29/Jun/2010:17:35:31 --0400] [dev.domain.com/sid#176bb40][rid#17841a0/initial] (2) [perdir E:/cyg/wwwroot/] remember E:/cyg/wwwroot/test.html to have Content-handler 'text/html' 127.0.0.1 - - [29/Jun/2010:17:35:31 --0400] [dev.domain.com/sid#176bb40][rid#17841a0/initial] (2) [perdir E:/cyg/wwwroot/] strip document_root prefix: E:/cyg/wwwroot/test.html -> /test.html 127.0.0.1 - - [29/Jun/2010:17:35:31 --0400] [dev.domain.com/sid#176bb40][rid#17841a0/initial] (1) [perdir E:/cyg/wwwroot/] internal redirect with /test.html [INTERNAL REDIRECT] 127.0.0.1 - - [29/Jun/2010:17:35:31 --0400] [dev.domain.com/sid#176bb40][rid#17841a0/initial] (1) force filename redirect:/test.html to have the Content-handler 'text/html' Works ----- 127.0.0.1 - - [29/Jun/2010:17:35:49 --0400] [dev.domain.com/sid#176bb40][rid#17901d0/initial] (3) [perdir E:/cyg/wwwroot/] strip per-dir prefix: E:/cyg/wwwroot/test.bogus -> test.bogus 127.0.0.1 - - [29/Jun/2010:17:35:49 --0400] [dev.domain.com/sid#176bb40][rid#17901d0/initial] (3) [perdir E:/cyg/wwwroot/] applying pattern '(.*)\.bogus' to uri 'test.bogus' 127.0.0.1 - - [29/Jun/2010:17:35:49 --0400] [dev.domain.com/sid#176bb40][rid#17901d0/initial] (2) [perdir E:/cyg/wwwroot/] rewrite 'test.bogus' -> 'test.html' 127.0.0.1 - - [29/Jun/2010:17:35:49 --0400] [dev.domain.com/sid#176bb40][rid#17901d0/initial] (3) [perdir E:/cyg/wwwroot/] add per-dir prefix: test.html -> E:/cyg/wwwroot/test.html 127.0.0.1 - - [29/Jun/2010:17:35:49 --0400] [dev.domain.com/sid#176bb40][rid#17901d0/initial] (2) [perdir E:/cyg/wwwroot/] strip document_root prefix: E:/cyg/wwwroot/test.html -> /test.html 127.0.0.1 - - [29/Jun/2010:17:35:49 --0400] [dev.domain.com/sid#176bb40][rid#17901d0/initial] (1) [perdir E:/cyg/wwwroot/] internal redirect with /test.html [INTERNAL REDIRECT] 127.0.0.1 - - [29/Jun/2010:17:35:49 --0400] [dev.domain.com/sid#176bb40][rid#17de4c8/initial/redir#1] (3) [perdir E:/cyg/wwwroot/] strip per-dir prefix: E:/cyg/wwwroot/test.html -> test.html 127.0.0.1 - - [29/Jun/2010:17:35:49 --0400] [dev.domain.com/sid#176bb40][rid#17de4c8/initial/redir#1] (3) [perdir E:/cyg/wwwroot/] applying pattern '(.*)\.bogus' to uri 'test.html' 127.0.0.1 - - [29/Jun/2010:17:35:49 --0400] [dev.domain.com/sid#176bb40][rid#17de4c8/initial/redir#1] (1) [perdir E:/cyg/wwwroot/] pass through E:/cyg/wwwroot/test.html Thanks again to anyone who has more thoughts on the matter. I'll be glad to test out specific options and configurations if you like, or if you need to see a full set of configs for the given server, I can provide those as well. - Greg --------------------------------------------------------------------- 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