Forums / Install & configuration / Mod_Rewrite: PHP -> HTML

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