ID:               38141
 User updated by:  martel at post dot pl
 Reported By:      martel at post dot pl
-Status:           Bogus
+Status:           Open
 Bug Type:         Apache2 related
 Operating System: Linux Gentoo
 PHP Version:      5.1.4
 New Comment:

I have created an issue in the apache bugtracker. After short
discussion and a lot of examples they claim it's not an Apache bug but
the mod_php one.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40102


Previous Comments:
------------------------------------------------------------------------

[2006-07-23 12:49:29] [EMAIL PROTECTED]

It's some Apache bug/feature since we only set SCRIPT_NAME to whatever
Apache returns.

------------------------------------------------------------------------

[2006-07-19 12:19:50] martel at post dot pl

Tested it some more. 

When the RewriteRule is placed under <Directory> or .htaccess it is set
correctly. When placed under <VirtualHost> it is initialized with some
bogus value.

------------------------------------------------------------------------

[2006-07-19 11:49:55] martel at post dot pl

Description:
------------
$_SERVER['SCRIPT_NAME'] is set incorrectly depending on where you place
the mod_rewrite rule. If it is placed in .htaccess, the SCRIPT_NAME is
initialized correctly but when you place the same rule in VirtualHost
in server config it is an empty string.

Not sure if it is a PHP or Apache bug but I'll start here.

The rule is:

    RewriteEngine On
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1

Or (it's not relevant - both have the same result):

    RewriteEngine On
    RewriteRule !\.(js|ico|gif|jpg|png|css|swf)$ index.php

Apache2 SAPI. Apache version is 2.0.58 but I guess it may not be
relevant. 


Reproduce code:
---------------
// For the URL of 'http://test.nebula.intranet/archive/2006/06'. 
// File 'index.php' is located at the root of virtual host
(http://test.nebula.intranet/index.php).

var_dump($_SERVER['SCRIPT_NAME']);

Expected result:
----------------
string(10) "/index.php"

Actual result:
--------------
string(0) ""


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38141&edit=1

Reply via email to