Forum Moderators: open
I believe that you can write a little PHP script that will do this for you... Check around, I will too and post back here...
[edited by: mipapage at 6:18 pm (utc) on Dec. 13, 2003]
The big problem is changing all of the links inside the pages.
I thought there might be some software that does this automatically -- i see so many programs that change PHP to HTML.
I believe you may want to search for 'semi dynamic pages'. This script would make your job lightening fast, provided that you have a list of the url's for the dynamic pages that you are after.
FYI - a dynamic page is generated on the fly, every time there is a request for that page. This would tax the database, provided that the content for the dynamic page is coming from the database.
If a pages content doesn't change very often, then people sometimes use what is referred to as a semi-dynamic page - you take a dynamic page (i.e. a PHP page generated with content from the database) and then save the generated HTML to be used as the live page.
Any time the content for the semi-dynamic page needs to be changed, it is done so in the database, the dynamic page regenerated, and html saved again to be used as the live page.
...to point to '###.html' instead of '###.php' I guess.
You could
- force *.php to be parsed as html
- use modRewrite to rewrite *.html to *.php or vice versa or whatever
- use a regex tool and change *.php to *.html (okay, you can't do that because of external links, but if you put your domain name in the regex it should work).
In terms of changing the pages to html, Google on 'wget'. You should be able to do it that way pretty quickly as long as you don't have a lot of orphan pages.
Tom
RewriteEngine on
RewriteRule ^([[:punct:]/:\\-\'(){}.&=_a-zA-Z0-9\ ]*).html $1.php
into a .htaccess file and every php page (ex. home.php) will become a html page, and will appear to be static (ex. home.html) you will still be able to access the php file like normal, but you will also be able to access it like a html file.. just make sure your host has ModRewrite enabled and you are allowed to use it. Oh yeah, you can use this to shorten your php file names (ex. modules.php?name=testerthingy&page=1 could be test-1.html)
RewriteRule ^test-([0-9]*).html modules.php?name=testerthingy&page=$1
You can even make files look like dirs..
RewriteRule ^weather/([0-9]*) weather.php?zip=$1
so if you went to weather/97222 you would be seeing weather.php?zip=97222.. There are a lot of things you can do with ModRewrite..
If the database is taking a hammering I would suggest they get a better database, or else try simplifying some of the sql commands by using views and queries internal to the db itself.