Forum Moderators: phranque
URL : www.example.com/review_10.html
... gets internally re-written (so the CMS can understand it) to :-
www.example.com?review=10&view=full
Where that example rarely (if ever) changes in content or markup, I could dump it to disk via some kind of shell script calling wget:-
wget www.example.com/review_10.html
That would then dump a static version of the page on disk, to save DB and PHP having to be involved in future viewing of that page.
To do that, I need to do something conditional like this in .htaccess:-
if (!file_exists(url)) {
do mod_rewrite rule
}
else {
do nothing, let apache serve as static file
}
Essentially, it's a form of caching - try to dump static pages, under the "new" URL to disk and serve those where they exist, otherwise do the mod_rewrite rule to let PHP generate the script dynamically.
I hope I'm making sense here. I'm curious if this is possible, and if so is anyone doing anything like this and if so, does it work and does it work well or are there considerations which mean it's a bad idea?
TJ