WordPress as CMS – Permalink Rewriting Fixed! (and new thoughts on Sections)

By Sol in Lab

I’ve fixed the URL rewriting issue I was having. The problem was that the regular expressions used to determine the post data (either the post’s name or id based on the permalink structure) were not properly handling different base URLs. This was evidenced when I installed the plugin on a WordPress install for a real website (as opposed to my local dev server). The regular expressions were no longer finding the post data, but instead returning data from another part of the URL string.

I’ve just finished rewriting the regular expressions, as well as cleaned up the URL rewriting code as a whole, so it’s working much better now.

The next issue: Section storage.

A couple days ago, I began to wonder whether I was storing the Section data in the best possible way. So I’ve been working out different solutions to see which one would be the most robust and future-proof. So far, there are major advantages and disadvantages for each solution. I’d like to implement the most flexible solution (to provide functionality for any possible situation), but I think I need to focus more on how sections will be used 99% of the time.