Forum Moderators: coopster

Message Too Old, No Replies

super slim cms?

cms

         

NoClue

8:59 pm on Jul 3, 2005 (gmt 0)

10+ Year Member



Hi all,

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.

mexicoshanty

4:49 am on Jul 4, 2005 (gmt 0)

10+ Year Member



Do you want content to update at runtime or do you want to generate static html files that are updated whenever you decide?

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

NoClue

5:12 am on Jul 4, 2005 (gmt 0)

10+ Year Member



Hi Mexicoshanty,

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!

jamie

8:14 am on Jul 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi noclue,

wget is a useful tool for generating static copies of dynamic sites.

mexicoshanty

4:16 pm on Jul 4, 2005 (gmt 0)

10+ Year Member



Yeah static pages would be better performance wise but it depends on how often your content changes and how much traffic you get to your site. Unless you're getting a thousand hits an hour then i dont see anypoint in generating static pages, you may as well take advantage of the server hardware and make your site more dynamic.

NoClue

6:49 pm on Jul 4, 2005 (gmt 0)

10+ Year Member



Thanks, Jamie, Mexicoshanty,

since my site isn't drawing millions of visitors <cough> yet... ;-) I think I'll try and figure out how to mod rewrite my dynamic url to a more pleasing one, thanks for the help!