Bug?: php api cgi + mod_rewrite + nVH + ForceVirtualHost=true

Author Message

Björn Dieding@xrow.de

Wednesday 12 January 2005 12:32:30 am

I have notice the following...

When i have the setup mentioned in the title, I always get my systems urls like that...

http://host/index.php?/alias/to/node

Is there a way to take out the "index.php?" from the URL? Or is there some kind of resriction because of the cgi like that parameteres can't be passed if you use urls like "http://host/alias/to/node"?

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Derick Rethans

Wednesday 12 January 2005 12:45:58 am

I think this is a bug, which I fixed (but not committed yet). Can you try the following:

Index: lib/ezutils/classes/ezsys.php
===================================================================
--- lib/ezutils/classes/ezsys.php   (revision 10512)
+++ lib/ezutils/classes/ezsys.php   (working copy)
@@ -615,7 +615,7 @@
      \return the variable named \a $variableName in the global \c $_SERVER variable.
              If the variable is not present an error is shown and \c null is returned.
     */
-    function &serverVariable( $variableName, $quiet = false )
+    function serverVariable( $variableName, $quiet = false )
     {
         if ( !isset( $_SERVER[$variableName] ) )
         {
@@ -780,6 +780,7 @@
             eZDebug::writeNotice( eZSys::serverVariable( 'PHP_SELF' ), 'PHP_SELF' );
             eZDebug::writeNotice( eZSys::serverVariable( 'SCRIPT_FILENAME' ), 'SCRIPT_FILENAME' );
             eZDebug::writeNotice( eZSys::serverVariable( 'DOCUMENT_ROOT' ), 'DOCUMENT_ROOT' );
+            eZDebug::writeNotice( eZSys::serverVariable( 'REQUEST_URI' ), 'REQUEST_URI' );
             eZDebug::writeNotice( ini_get( 'include_path' ), 'include_path' );
         }

@@ -825,6 +826,7 @@
         $scriptName = eZSys::serverVariable( 'SCRIPT_NAME' );
         // Get the webdir.

+        $wwwDir = "";
         if ( $force_VirtualHost && ! $isCGI )
         {
             $wwwDir = "";
@@ -868,7 +870,18 @@
                 // Get the right $_SERVER['REQUEST_URI'], when using nVH setup.
                 if ( ereg( "^$wwwDir$index(.*)", $phpSelf, $req ) )
                 {
-                    $requestURI = $req[1];
+                    if (! $req[1] )
+                    {
+                        if ( ereg( "^$wwwDir(.*)", $requestURI, $req ) )
+                        {
+                            $requestURI = $req[1];
+                            $index = '';
+                        }
+                    }
+                    else
+                    {
+                        $requestURI = $req[1];
+                    }
                 }
             }
         }

The reason why it's not committed yet because I couldn't test it in a lot of different situations yet.

Lazaro Ferreira

Wednesday 12 January 2005 12:56:19 am

Hi,

I've tried this without sucess :

http://ez.no/community/forum/install_configuration/htaccess_hidden_at_last

 

Lazaro
http://www.mzbusiness.com

Björn Dieding@xrow.de

Wednesday 12 January 2005 1:15:12 am

Thx Derick,

I give it a try and let you know.

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Björn Dieding@xrow.de

Wednesday 12 January 2005 5:06:01 am

http://www.ez.no/bugs/view/6085

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Derick Rethans

Monday 17 January 2005 4:06:12 am

Hmm, your patch does work for me, and so does mine... but I couldn't reproduce the "wrong" case from before I wrote this patch... strange.

Björn Dieding@xrow.de

Monday 17 January 2005 4:17:22 am

Have you tested your patch with mod_rw and forcevirtualhost=true then it should fail because it still prepends the "index.php?" in urls...

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 22:38:15
Script start
Timing: Jan 18 2025 22:38:15
Module start 'layout'
Timing: Jan 18 2025 22:38:15
Module start 'content'
Timing: Jan 18 2025 22:38:16
Module end 'content'
Timing: Jan 18 2025 22:38:16
Script end

Main resources:

Total runtime0.7959 sec
Peak memory usage4,096.0000 KB
Database Queries71

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 589.2734152.6406
Module start 'layout' 0.00650.0036 741.914139.4766
Module start 'content' 0.01010.7844 781.3906627.9453
Module end 'content' 0.79450.0013 1,409.335920.1094
Script end 0.7958  1,429.4453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4247160.0002
Check MTime0.00140.1763160.0001
Mysql Total
Database connection0.00090.114610.0009
Mysqli_queries0.727991.4627710.0103
Looping result0.00070.0858690.0000
Template Total0.763996.020.3819
Template load0.00220.282020.0011
Template processing0.761695.696920.3808
Template load and register function0.00010.017210.0001
states
state_id_array0.00050.064210.0005
state_identifier_array0.00070.084420.0003
Override
Cache load0.00190.2351310.0001
Sytem overhead
Fetch class attribute can translate value0.00070.083630.0002
Fetch class attribute name0.00110.132190.0001
XML
Image XML parsing0.00240.306330.0008
class_abstraction
Instantiating content class attribute0.00000.0038130.0000
General
dbfile0.00240.2963220.0001
String conversion0.00000.001440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs