Mod_Rewrite: PHP -> HTML

Author Message

Kevin Landers

Friday 28 November 2003 6:17:17 pm

It is my understanding that mod_rewrite can be used in certain circumstances for making a dynamic PHP page into a static HTML page.

I am curious as to whether this can be done with eZ publish and mod_rewrite.

I would prefer all output to be in HTML for our clients.

Any help is kindly appreciated,
Kevin L.

Marco Zinn

Saturday 29 November 2003 4:58:25 am

Hi Kevin,
your understanding may not be completly correct.
What you can do is this:
- Use ezPublish to create all your pages dynamically
- "Freeze"(copy, mirror) some or all of these pages. That means: Save the dynamically created pages of ez3 to static HTML. ez3 does IMHO not have a feature to do this (some kind of "export to static HTML"), but you can use some website copy tool for this.
- If all of your site is static now, you probably need no rewrite rule
- If some is dynamical (Forums), you can use rewrite rules to "switch" between static page serving and dynamic page servering (ez), depending of the URL for example.

Some links for this
- http://ez.no/developer/ez_publish_3/contributions/ez_sitecopier
- http://www.httrack.com/
- http://ez.no/developer/ez_publish_3/forum/setup_design/benchmarks_dont_look_too_great_more_efficient_caching_is_needed
(lower part of the thread)

Marco
http://www.hyperroad-design.com

Marino Carlos

Monday 01 December 2003 6:33:53 pm

Also, with mod_rewrite what you can do is that any request to a .html page be served by a php script. That way, you can request index.html, for example, and instruct the server to serve index.php.

The result is that the page name at the URL will end in .html, but it will be build by the same php script anyway. So it wont convert dynamic page to static ones, but URLs will look like if they were static html files.

There are different opinions about search engines indexing better html urls than php ones, and maybe this can be one of the only reasons to use mod_rewrite for this purpose (if it were true).

Also keep in mind that extra rewriting rules means extra for Apache.

Paul Forsyth

Tuesday 02 December 2003 12:29:45 am

sorry, wrong forum

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

Main resources:

Total runtime0.6194 sec
Peak memory usage4,096.0000 KB
Database Queries64

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 589.1563152.6250
Module start 'layout' 0.00480.0021 741.781339.4453
Module start 'content' 0.00690.6111 781.2266614.8516
Module end 'content' 0.61800.0013 1,396.078112.1641
Script end 0.6193  1,408.2422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.4879160.0002
Check MTime0.00130.2094160.0001
Mysql Total
Database connection0.00060.100410.0006
Mysqli_queries0.573192.5264640.0090
Looping result0.00060.0913620.0000
Template Total0.594596.020.2973
Template load0.00180.289820.0009
Template processing0.592795.701620.2964
Template load and register function0.00010.023410.0001
states
state_id_array0.00100.154510.0010
state_identifier_array0.00060.099220.0003
Override
Cache load0.00150.2466290.0001
Sytem overhead
Fetch class attribute can translate value0.00050.088740.0001
Fetch class attribute name0.00160.250750.0003
XML
Image XML parsing0.00090.149240.0002
class_abstraction
Instantiating content class attribute0.00000.001650.0000
General
dbfile0.00080.1275160.0000
String conversion0.00000.000940.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs