Custom CMS
December 4, 2007
Over the last couple of weeks, I’ve been writing a mini-CMS (Content Management System) for a client, and I’m really pleased with it. There’s even some bits that I’ve never seen anywhere else, including an auto-generated .htaccess file – which is making for some interesting applications in itself.
It’s been a fun little challenge, and has stretched my knowledge of PHP even further, which (to me) is always a good thing.
One thing that’s always bugged me with CMS products is that you normally end up with a URL that looks like www.site.com/index.php?page_id=456§ion_id=2 or something. About as user-unfriendly as it’s possible to be. WordPress is another one that’s guilty – for example, just look at the URL for an individual post – /index.php/?p=4720 . Just ugly. And we won’t even go into things like archives.
The custom-written one I’ve done means you can have simply www.site.com/aboutus (for example) which then uses .htaccess to go from /aboutus to index.php?page_id=xxx . But the beauty of it is, as with all things .htaccess, you don’t see the page_id=xxx bit. Ever.
The only time that something like this could blow up in my face is if two destinations were set to be the same – say two /aboutus files. But with the destination bit being set as Unique in the database, even that eventuality seems to disappear.
I’m not going to be using comments etc. in this client’s site, which probably makes things a lot easier too, but I have to say, this is a small development that I’m really proud of.