Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 1527 invoked from network); 29 Jun 2010 20:07:38 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Jun 2010 20:07:38 -0000 Received: (qmail 23727 invoked by uid 500); 29 Jun 2010 20:07:35 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 23712 invoked by uid 500); 29 Jun 2010 20:07:34 -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 23704 invoked by uid 99); 29 Jun 2010 20:07:34 -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 20:07:34 +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 20:07:27 +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 o5TK76Ck014915 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 29 Jun 2010 16:07:06 -0400 X-DomainKeys: Sendmail DomainKeys Filter v1.0.2 vixen.foxpaws.net o5TK76Ck014915 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: mime-version:content-type:x-greylist; b=ZJMRYIhdKFBiCXsXq/YH7I1ad1/sCPkx+2QZrifITiSlbSr4Umn/eWIxJW84u2eOW ev6ZiLSGOlnY3qutep1IrNUggJ6r0hhbu+VKF6PfklK58fy8cF6wL18BKGFZv7T9C3H J3JXrdbz+/BT5d0DLnqyvYIVs1FgzCQcmkQu+wQ= X-DKIM: Sendmail DKIM Filter v2.8.3 vixen.foxpaws.net o5TK76Ck014915 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=foxpaws.net; s=vixen; t=1277842026; i=@foxpaws.net; bh=Drn32FwiG3OxFyqie1Gkh5aCJyi7OrmNmzCByPziTYI=; h=Date:To:From:Subject:Mime-Version:Content-Type; b=hurzim8SfImdZFZ8uj/wPGQMrD0zV7jOqRlie5G/7tQH464HX1Ai+tUuMoWUMP1ZX 3KTe6eUiH35QShy02/xplCrmbHJfWHKdwCGPYAfVzzlXPK4SK4YCGDoEEFFYn84P1X WhZwcWS4/Uf8FT6AwQlf/RQ6EFCCHS6a2xZoeeG0= Message-Id: <201006292007.o5TK76Ck014915@vixen.foxpaws.net> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Tue, 29 Jun 2010 16:06:47 -0400 To: users@httpd.apache.org From: Greg Neujahr 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 16:07:06 -0400 (EDT) X-Virus-Checked: Checked by ClamAV on apache.org Subject: [users@httpd] RewriteRule failing on windows when changing content-handlers I'm having a difficult time figuring out why a RewriteRule isn't working, so I'm turning to you folks for some potential help. The problem is as follows: On a 64 bit Windows 7 machine, I have installed apache in D:\Apache. The root of the web directory is in E:\cyg\wwwroot. I am using a RewriteRule inside a .htaccess file located in e:\cyg\wwwroot\oxfordv2 to rewrite non-existant .phps files into .php files and at the same time change the handler to be application/x-httpd-php-source. When the rewrite happens, the browser reports a 404 error and the error log indicates that the script file is 'not found or unable to stat'. When the rule is moved directly into the VirtualHost container for the site, it functions without issue. I have provided what I think are relative snippets of information below. If you need further details, please ask and I will provide them. The URL being accessed in both cases is http://dev.domain.com/oxfordv2/page.phps. It is successful when placed into the VirtualHost but not when in the .htaccess file. If I leave off the content-header portion of the rewrite while in the .htaccess file, it properly redirects to the new file, but obviously processes the file as a .php file and not a .phps file. The output of error.log when the rewrite fails in .htaccess: [Tue Jun 29 15:45:20 2010] [error] [client 127.0.0.1] script 'redirect:/oxfordv2/page.php' not found or unable to stat The output of rewrite.log when the rewrite fails in .htaccess: 127.0.0.1 - - [29/Jun/2010:15:48:39 --0400] [dev.domain.com/sid#18a5b30][rid#18ba180/initial] (3) [perdir E:/cyg/wwwroot/oxfordv2/] strip per-dir prefix: E:/cyg/wwwroot/oxfordv2/page.phps -> page.phps 127.0.0.1 - - [29/Jun/2010:15:48:39 --0400] [dev.domain.com/sid#18a5b30][rid#18ba180/initial] (3) [perdir E:/cyg/wwwroot/oxfordv2/] applying pattern '(.*\.php)s$' to uri 'page.phps' 127.0.0.1 - - [29/Jun/2010:15:48:39 --0400] [dev.domain.com/sid#18a5b30][rid#18ba180/initial] (2) [perdir E:/cyg/wwwroot/oxfordv2/] rewrite 'page.phps' -> 'page.php' 127.0.0.1 - - [29/Jun/2010:15:48:39 --0400] [dev.domain.com/sid#18a5b30][rid#18ba180/initial] (3) [perdir E:/cyg/wwwroot/oxfordv2/] add per-dir prefix: page.php -> E:/cyg/wwwroot/oxfordv2/page.php 127.0.0.1 - - [29/Jun/2010:15:48:39 --0400] [dev.domain.com/sid#18a5b30][rid#18ba180/initial] (2) [perdir E:/cyg/wwwroot/oxfordv2/] remember E:/cyg/wwwroot/oxfordv2/page.php to have Content-handler 'application/x-httpd-php-source' 127.0.0.1 - - [29/Jun/2010:15:48:39 --0400] [dev.domain.com/sid#18a5b30][rid#18ba180/initial] (2) [perdir E:/cyg/wwwroot/oxfordv2/] strip document_root prefix: E:/cyg/wwwroot/oxfordv2/page.php -> /oxfordv2/page.php 127.0.0.1 - - [29/Jun/2010:15:48:39 --0400] [dev.domain.com/sid#18a5b30][rid#18ba180/initial] (1) [perdir E:/cyg/wwwroot/oxfordv2/] internal redirect with /oxfordv2/page.php [INTERNAL REDIRECT] 127.0.0.1 - - [29/Jun/2010:15:48:39 --0400] [dev.domain.com/sid#18a5b30][rid#18ba180/initial] (1) force filename redirect:/oxfordv2/page.php to have the Content-handler 'application/x-httpd-php-source' Output of rewrite.log when the rule is moved into the vhost entry: 127.0.0.1 - - [29/Jun/2010:15:51:18 --0400] [dev.domain.com/sid#1aa5b30][rid#1aba180/initial] (2) init rewrite engine with requested uri /oxfordv2/page.phps 127.0.0.1 - - [29/Jun/2010:15:51:18 --0400] [dev.domain.com/sid#1aa5b30][rid#1aba180/initial] (3) applying pattern '(.*\.php)s$' to uri '/oxfordv2/page.phps' 127.0.0.1 - - [29/Jun/2010:15:51:18 --0400] [dev.domain.com/sid#1aa5b30][rid#1aba180/initial] (2) rewrite '/oxfordv2/page.phps' -> '/oxfordv2/page.php' 127.0.0.1 - - [29/Jun/2010:15:51:18 --0400] [dev.domain.com/sid#1aa5b30][rid#1aba180/initial] (2) remember /oxfordv2/page.php to have Content-handler 'application/x-httpd-php-source' 127.0.0.1 - - [29/Jun/2010:15:51:18 --0400] [dev.domain.com/sid#1aa5b30][rid#1aba180/initial] (2) local path result: /oxfordv2/page.php 127.0.0.1 - - [29/Jun/2010:15:51:18 --0400] [dev.domain.com/sid#1aa5b30][rid#1aba180/initial] (2) prefixed with document_root to E:/cyg/wwwroot/oxfordv2/page.php 127.0.0.1 - - [29/Jun/2010:15:51:18 --0400] [dev.domain.com/sid#1aa5b30][rid#1aba180/initial] (1) go-ahead with E:/cyg/wwwroot/oxfordv2/page.php [OK] 127.0.0.1 - - [29/Jun/2010:15:51:18 --0400] [dev.domain.com/sid#1aa5b30][rid#1aba180/initial] (1) force filename E:/cyg/wwwroot/oxfordv2/page.php to have the Content-handler 'application/x-httpd-php-source' httpd.conf ---------- LoadModule php5_module "d:/php/php5apache2_2.dll" PHPIniDir "d:/php" AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps DocumentRoot "e:/cyg/wwwroot" Options Indexes FollowSymLinks AllowOverride FileInfo AuthConfig Limit Options Order allow,deny Allow from all Include conf/vhosts.conf vhosts.conf ----------- NameVirtualHost *:80 ServerName dev.domain.com DocumentRoot "e:/cyg/wwwroot" RewriteLog d:/apache/logs/rewrite.log RewriteLogLevel 9 e:\cyg\wwwroot\oxfordv2\.htaccess --------------------------------- Options +FollowSymLinks RewriteEngine On RewriteRule (.*\.php)s$ $1 [H=application/x-httpd-php-source] Apache is version 2.2.15, and PHP is 5.3.2. Thanks for any help or pointers you folks can provide me with. - 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