WordPress as CMS – Exploration
I’ve spent a good part of the day researching and testing different potential solutions to getting WordPress to act like a proper CMS. There are couple major roadblocks that will require some creativity (especially since my goal remains to leave the core WordPress code untouched). Honestly, I’m not sure if it will be possible (or productive) with the current version of WordPress. Nonetheless, I am optimistic that a solution will be found.
Currently, one of the main issues I need to find a solution for would be:
Customizing the Permalink Structure
I’ve done a fair amount of research and testing today regarding using Apache’s mod_rewrite. As always, regular expressions rule the day! I’ve determined the permalink structure I want and have written the rewrite rules for them, so it’s ready to go on Apache’s end.
This is the basic structure:
- Section –
/section_name/
- Tags –
/tag/tag_name/
- Tags in Section –
/section_name/category_name/
- Item –
/section_name/item_name
(Items will belong to one section only, while tagging will provide more general relational groupings) - Paged Item –
/section_name/item_name/page_number
or/section_name/item_name/page/page_number
(the choice is really only a matter of style and usability; they’ll both work equally well)
The trailing slashes play a large part in making this work. A URI ending with a slash indicates that there is more to be seen (thus a section or tag depending on position in the URI), while a URI with no trailing slash indicates that a specific content item is to be requested. I’ll of course need to look into providing some error correction, but the goal here is to get WordPress’ structure to mimic that of a manually-created directory structure. A structure like this would not be difficult at all in the world of static pages.
Now all I have to do is convince WordPress to play nice and let me modify its URL rewriting code without too much a fuss.