Smart URI handling for CMS engine?
I am writing a CMS engine that enhances the blog engine on my website. So far, the existing blog has only one smart URI handler - the one that converts /123
to /blog.php?p=123
and is currently executed by multiple statuses mod_rewrite
. I am afraid this method is cumbersome and clunky when I have smarter URIs in my CMS.
At the moment I was thinking about how this can be done in PHP, but it also seems semantically "evil". I would use a ErrorDocument 404
PHP script to use that parses the URI and dynamically includes the correct scripts (with a status code change to 200
).
Should I do this? Are there any better ways? I'm aiming for neat URI mining like Launchpad.net.
a source to share
The most common method is to redirect everything to index.php via mod_rewrite and do all of the URL parsing in php code. See for example Redirect everything to index.php
a source to share