SEF/Fancy/Pretty URLs

Whatever you want to call them (for the purposes of this post they are SEF URLs), they’re part of 1.3, so I thought it would be a good idea to talk a little bit about them.If you’ve no idea what I’m talking about then here’s a quick intro. SEF (Search Engine Friendly) URLs means the URL to a page on PunBB takes a form which resembles a more classic (static) website, and may well end in a prefix such as .html, 1.3 is going to ship with the option to use a number of what we are calling “URL schemes” which basically means a consistent style of URLs that will be used throughout the forum, wherever possible. One requirement of these is that apache is used with mod_rewrite enabled and you place a .htaccess file from the extras folder included with PunBB in the root of your forum.

A number of basic schemes will be included with PunBB, these will be firstly simple file and folder stuctures such as
http://forums.punbb.org/forum-23.html or http://forums.punbb.org/forum/23/
for the 23rd forum, it will also include two similar schemes which will also incorporate text from the title of the forum or post into the URL (this is the SEF part), such as
http://forums.punbb.org/forum23-Feature-requests.html or http://forums.punbb.org/forum23/Feature-requests/

1.3 will also come with the functionality to add more schemes simply by dropping files into a folder in a similar way styles or languages are added now.

When creating the URL schemes a number of important considerations had to be taken, first of all as this is PunBB it had to be as fast and as simple as possible for the elements of a link to be converted to a URL, so this is done simply with a list of the different URL formats and how each one should be output. Another important consideration was how permenant a URL would be when admins have the option to switch schemes. This has lead to a “hybrid” .htaccess file being created which processes URLs from all the provided schemes, meaning even if a URL scheme is not currently in use, the URLs it generated will still work (assuming .htaccess still exists as it did).

To round this off, I think we’ve managed to produce a simple but effective way to scheme URLs, and have implemented it in such a way it won’t lead to dead ends (and inevitably poor search engine rankings) in the future, however since this isn’t simply PHP there are a lot more variations from setup to setup than we normally have to deal with, so here’s where you come in. If you are testing 1.3 it would be extremely useful if you could try out the schemes it currently has available, and report back if you have any issues. If you do have issues please give as much information as you can, apache version is critical as well as exactly what kind of error you are having (500 or 404 server errors etc.).