Removing index.php from url in nVH setup

Author Message

Tomek Klaudel

Thursday 08 January 2004 1:21:42 am

My isp give me acces to mod_rewrite, but i can't put rewrite rulest into httpd.conf. I have it in .htaccess, so normally i has index.php in url.

I found that when i change lib/ezutils/classes/ezsys.php :

// Fallback... Finding the paths above failed, so $_SERVER['PHP_SELF'] is not set right.
if ( $siteDir == "./" )
$phpSelf = $requestURI;

to

// Fallback... Finding the paths above failed, so $_SERVER['PHP_SELF'] is not set right.
// if ( $siteDir == "./" )
$phpSelf = $requestURI;

(only comment "if ( $siteDir == "./" )" )

then everything working ok.
(I using Apache 3.X and ezP 3.2-3)

Best
Tomek

James Packham

Tuesday 04 May 2004 8:51:14 am

Nice one! I've spent ages looking for this solution (i.e. over a month) I don't know how but I've always used the wrong keywords I guess (things like "non virtual host", "get rid of index.php", "htaccess settings" etc).

I confirm that it also works in 3.3-4.

Regards,

James

Joel Hardi

Thursday 13 May 2004 12:15:51 pm

I'll also confirm this works ... but you can do the same thing without hacking core /lib code.

This is exactly what the ezroot operator is for. Just use ezroot instead of ezurl in all templates, i.e. <a href={"url"|ezroot}>

And be sure to override the default datatype template for <link> tags so links from within content work as well:

Override:

/design/standard/templates/content/datatype/view/ezxmltags/link.tpl

and change:

<a href={$href|ezurl} {section show=$target}target="{$target}"{/section}>{$content}</a>

to

<a href={$href|ezroot} {section show=$target}target="{$target}"{/section}>{$content}</a>

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 16:17:06
Script start
Timing: Jan 18 2025 16:17:06
Module start 'layout'
Timing: Jan 18 2025 16:17:06
Module start 'content'
Timing: Jan 18 2025 16:17:06
Module end 'content'
Timing: Jan 18 2025 16:17:06
Script end

Main resources:

Total runtime0.5838 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 589.5000152.6406
Module start 'layout' 0.00620.0020 742.140639.4766
Module start 'content' 0.00830.5738 781.6172541.3203
Module end 'content' 0.58210.0016 1,322.937512.1250
Script end 0.5837  1,335.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.6168160.0002
Check MTime0.00140.2392160.0001
Mysql Total
Database connection0.00100.164110.0010
Mysqli_queries0.532891.2701590.0090
Looping result0.00050.0922570.0000
Template Total0.551494.520.2757
Template load0.00270.469220.0014
Template processing0.548693.984520.2743
Template load and register function0.00020.040910.0002
states
state_id_array0.00230.402010.0023
state_identifier_array0.00130.227320.0007
Override
Cache load0.00200.3479280.0001
Sytem overhead
Fetch class attribute can translate value0.00050.081230.0002
Fetch class attribute name0.00190.320240.0005
XML
Image XML parsing0.00080.129130.0003
class_abstraction
Instantiating content class attribute0.00000.002440.0000
General
dbfile0.00080.1362160.0000
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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs