Are you looking for a simple flatfile CMS that can be used to deploy thousands of small sites with little to no server load? Follow this series, and we’ll see how to build such a system, expanding it as the need arise.
In this and the next few posts, we’ll see how to create a simple flat file blog or CMS in PHP.
I mean a really simple one, useful when you have just a few pages to manage, and installing WordPress would be an overkill.
Why flat file?
Because if you do web design you may need to populate many sites with your clients content, often using a cheap hosting service where mySql is not available, or has a limit on the number of simultaneous connections.
For a small number of pages, such as a Mini Site with 30/50 pages with product description, articles of 500 words each, and the usual About / Contact / Privacy pages, the resulting file would be less than 50Kb and allow for immediate deployment of the site wherever you want.
To keep things simple and hacker proof, we’ll not include an admin backend. Adding articles will be done offline in a text editor.
If you have ever experienced what does it mean to manage 60 or more client’s sites on dynamic platforms such as WordPress or Joomla, then you’ll appreciate this approach even more.
Let’s start outlining the requirements for our blog/cms. It should be able to:
- Handle SEO friendly urls
This means urls will look like mysite.com/this-is-a-post.html instead of the ugly mysite.com/index.php?m=73.
- Have SEO friendly page titles
As well as per-page meta tags and meta descriptions.
- Be able to be used as a Blog or as a CMS
Here we’ll draw a line and state that author and post date are optional items. When present, the page will be considered a blog post. Otherwise a “static” page. This will cover 99% of commercial “shop window” mini sites.
- Be able to make use of custom or Artisteer templates
If you don’t know Artisteer, it’s a remarkable piece of software, available both for Mac and Windows. It creates great looking cross browser templates for WordPress, Joomla, Drupal and static sites.
Hacking the xhtml template Artisteer provides, we’ll be able to quickly change the look of our Minisite.Of course we can also code the page by hand or using another web design tool.
- Graceful error handling
Providing a meaningful 404 error code if the url is not in the database is a must.
Again, the goal is to keep code as short and simple as possible, but with a little pre-planning we can make sure the script is scalable and can easily be expanded to handle more complex tasks.
Interested? then head on to the next post where we’ll start building it.