Forum Moderators: coopster
I'm slowly getting familiar with all the amazing features of php, and once again confusion has struck!
What I want to do:
Update site with new content through a form, automatically creating flat html file (and update sitemap) (php, mysql)
How:
I've split content into 4 variables; Title, metatags, description and text and put these into a mysql database
With this it is easy to get content into a template or php file from the mysql database.
My question now is: can I get my page "index.php?page=widget123" displayed/output as "widget123.html"?
Ps What I've done before is create "widget123.html" and fill it with content through a database call. Now I would like everything done with 1 push of the button.
If i were you i would use mod rewrite (an addon module for apache, except comes installed by default) to rewrite the url widget123.html to index.php?page=widget123. If the webserver you're working on is apache and it allows .htaccess to override rules, place the following rule in the .htaccess file in the document root.
RewriteRule ^(*)$ /index.php?page=$1
This way your visitors will be seeing widget123.html but it's really /index.php?page=widget123
thanks for the heads-up on mod rewrite! I'll dive into it again and figure out how it works.
You are referring to static html pages as well; this probably is better performance wise? I imagine I could have an automated job make static pages on the server which then can serve up already generated pages. Could you elaborate a bit?
thanks!