“I want WordPress (pretty) URL’s” is not really anything to go on. We don’t know how your site’s URL’s are structured since you don’t really have any pages up except “Home” and “About”. If that is the way it will be, removing the .php extension is what I suggested above.

There are lots of ways of achieving what you want to achieve. The first is to use .htaccess to rewrite everything to index.php (except the files you want a user to access directly). You can then use something like:

$_SERVER

To determine their perceived URI and act upon it (remember to preserve GET request parameters).

An alternative method, if you have a consistent and predictable structure, is to act on the URL in .htaccess to turn the URI into GET parameters. For example, Zend URLs have a very strict format:

This means .htaccess can (if you want) split those components and formulate a GET request, rewriting (again) to index.php.

However, creating a CMS is a big task. I assume you are using it as a learning experience. Unless you specifically want to learn how to construct these sorts of module, I would focus on more fundamental components first. Ugly URLs don’t make your system unusable and are best addressed at or near the end, once you know the sort of information your URLs will contain.

You don’t seem to realise how these are connected. As I allude to above, parts of this process can be done by either. It is down to you as to which you want to use.

Personally I favour .htaccess doing a minimal amount of work, as I think it is easier to preserve backwards compatability that way. However, if you take a look at http://camendesign.com (look at both his php and .htaccess source) you will see that he uses .htaccess heavily in his rewrites.

Tips

Categories

We have a pretty good* newsletter.

Email Address

CSS-Tricks* is created, written by, and maintained by Chris Coyier and a team of swell people. It is built on WordPress, hosted by Media Temple, and the assets are served by MaxCDN. The fonts are Source Sans Pro and Source Code Pro. It is made possible through sponsorships from products and services we like.