Topic: Feedback wanted on URL rewriting thing

I'm considering making life easier for people who want to use PunBB with so called "search engine friendly" URL's. Personally, I can't really see the point of rewriting viewtopic.php?id=5 into viewtopic-5.html or viewtopic/5 or whatever. It does not add any real semantic value to the URL's and it does not improve search engine spider "friendlyness". At least not when we're talking about URL's without session ID's and relatively short URL's such as the ones used by PunBB. Still, SEF seems to be all the rage these days, so who am I to oppose it :)

In a previous topic, ShawnBrown and I discussed different ways of making it easier to modify PunBB to work with SEF URL's. I suggested adding a function to the PunBB function library that generates the URL based on a set of parameters. Shawn suggested a different approach where some kind of URL template was used to construct links within the forum. I haven't been able to decide which method is preferable, so I thought I would ask you guys. Read the posts made by Shawn and myself in the topic linked to above and tell me (in this topic) what you think.

Just for fun, I threw together a small function that illustrates how my method would work:

function pun_link($script, $parameters = array(), $anchor = '')
{
    $link = $script;

    if (!empty($parameters))
    {
        $query_str = array();

        foreach ($parameters as $parameter => $value)
            $query_str[] = $parameter.'='.$value;

        $link .= '?'.implode('&', $query_str);
    }

    if ($anchor != '')
        $link .= '#'.$anchor;

    return $link;
}

The code above is just test code, so don't give me a hard time on the implementation :)

The general idea is to somehow centralize the way in which PunBB generates the links to forums, topic, posts, profiles etc. within the forum so that people who want to use SEF URL's can just drop in a new function or some new templates and be done with it. If the implementation is elegant, I might even consider adding the two alternatives to the base code (along with a .htacces file).

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Feedback wanted on URL rewriting thing

I wanted to mod punBB myself to support url rewrite. My first idea was to let the script generates it's pages like it does in normal situation. When finished procces the output with a function like str_replace to replace al the links with the new url_rewrite strings. this could be done like the languages are handled.

unfortunally this is offcourse not going to work because of the way punbb is coded.

regarding your code. How are you going to handle the forms ? Are you going to rewrite those also ?

Re: Feedback wanted on URL rewriting thing

I see no point for it hmm
But some people want it, and you made a bit of a mod for it, so now they might be happy smile

Good job Rickard!

Indocron
$theQuestion = (2*b) || !(2*b);

Re: Feedback wanted on URL rewriting thing

i suppose that would be a rather neat way of doing it as you could change the function to anything you wanted, and its not very big to add, although i still don't really think its worth it tongue

5

Re: Feedback wanted on URL rewriting thing

Yeah, I'm not entirely convinced that these URLs are really more friendly to search engines, but they sure look pretty. I think retro is in and every just loves the old straight up HTML feel. Or something like that.

My main complaint with pretty URLs is that a long list of parameters either become messy or make no sense. Take the searching in punBB for example. Things become more clean since everything is handled through a search id, but if it weren't for that, you're presented with a URL like this:

http://www.macaddict.com/forums/search. … rch=Submit

How in the world do you make that clean? You either do things like "search/action/search/keywords/GUI", but that doesn't really make sense, since these aren't in any way "subdirectories." The other solution is something like this "search/search/GUI", but that requires each parameter always be passed in in the same order, and it still doesn't really make semantic sense. And then what if you want a new parameter thrown somewhere in there? You end up ruining the order of everything else, and killing these supposedly "permanent" URLs.

I think permanency is the main draw draw of these URLs. Well, that and sexiness. wink If you happen to switch systems down the road, the transition is far more transparent, if you already have a good URL system setup. Then you just make your new system behave as your old one did, and no messy redirects between something stupid like viewtopic.php and topic.php. You set your original URLs up in such a generic manner that it should be extensible to any system down the road.

Now of course, if you really want to get with the cool crowd, the urls aren't supposed to have numerical ids in them, but rather textual handles. But it can't just be based on the subject title, since that can be edited, it has to be a non-editable field. But at some point, it just becomes insane. It's manageable on personal web sites or largely static sites, but this whole business gets infinitely more messy when thrown into the dynamic world.

Despite all my bashing, I do like them, and wouldn't mind seeing a filter function in future releases. Maybe not all URLs would be rewritten, but the basics like topics, posts, forums, etc. It sure beats what I did at MacAddict. It involves a PHP shell script that performs a search and replace on all the files based on some crazy parameters. It's not pretty, but it works... for the most part.

As for which method, I haven't looked at either in great detail, but they both seem to do pretty much the same thing. Rickard's via arrays, Shawn's via strings. To me arrays are always cleaner and therefor preferable, but that's just me and my fetish for arrays.

Hard work may not kill you, but why take chances?

Re: Feedback wanted on URL rewriting thing

GUI wrote:

My main complaint with pretty URLs is that a long list of parameters either become messy or make no sense. Take the searching in punBB for example. Things become more clean since everything is handled through a search id, but if it weren't for that, you're presented with a URL like this:

http://www.macaddict.com/forums/search. … rch=Submit

How in the world do you make that clean? You either do things like "search/action/search/keywords/GUI", but that doesn't really make sense, since these aren't in any way "subdirectories." The other solution is something like this "search/search/GUI", but that requires each parameter always be passed in in the same order, and it still doesn't really make semantic sense. And then what if you want a new parameter thrown somewhere in there? You end up ruining the order of everything else, and killing these supposedly "permanent" URLs.

Good thing PunBB uses the search result cache then smile

GUI wrote:

I think permanency is the main draw draw of these URLs. Well, that and sexiness. wink If you happen to switch systems down the road, the transition is far more transparent, if you already have a good URL system setup. Then you just make your new system behave as your old one did, and no messy redirects between something stupid like viewtopic.php and topic.php. You set your original URLs up in such a generic manner that it should be extensible to any system down the road.

Good point.

GUI wrote:

Now of course, if you really want to get with the cool crowd, the urls aren't supposed to have numerical ids in them, but rather textual handles. But it can't just be based on the subject title, since that can be edited, it has to be a non-editable field. But at some point, it just becomes insane. It's manageable on personal web sites or largely static sites, but this whole business gets infinitely more messy when thrown into the dynamic world.

Yes. Reflecting the actual contents of the page in the URL is preferable, but like you said, it's going to get messy. I can already see the bug reports pouring in smile

GUI wrote:

Despite all my bashing, I do like them, and wouldn't mind seeing a filter function in future releases. Maybe not all URLs would be rewritten, but the basics like topics, posts, forums, etc. It sure beats what I did at MacAddict. It involves a PHP shell script that performs a search and replace on all the files based on some crazy parameters. It's not pretty, but it works... for the most part.

So that's how you did it smile

"Programming is like sex: one mistake and you have to support it for the rest of your life."

7

Re: Feedback wanted on URL rewriting thing

I'd love punbb using cool uris smile
I think the pun_link solution is a good one; with a little bit of php knowledge everybody should be able to have the urls he wants to have.

Thanks Rickard for this great forum anyway.
++

8 (edited by Jérémie 2005-02-14 09:37)

Re: Feedback wanted on URL rewriting thing

Well, I may be dumb, but I can't see the differences between yours and Shawn's.

About "clean URLs" per se, I do think it's a good idea. Not a very urgent or needed one, as punBB is indexed quite alright with the ugly ones, but still a good thing.

About the search URLs, one way is to let them be "ugly". The other one is to define each parameter with its tag... like domain.tld/search/author=TheAuthor/keywords=OneKeywords&AnotherKeyword/ etc. But it's not really an improvement over the current schemes.

One thing that, in my opinion, have to be possible (and is definitely an improvement over the current system) is the ability to rename each tag used, so for example it can be localized.

Re: Feedback wanted on URL rewriting thing

Hi Rickard. I think it's fantastic that you're seriously considering this important topic, and your proposed solution may indeed work well. As you point out, search engine indexing should not be an end goal, since nearly every search engine already indexes URIs with parameters in them. The true goal, as GUI already pointed out, is future proofing.

If future development needs require, for example, a switch to a Python or Ruby-based solution, the presence of the script names and extensions becomes yet another legacy hassle to support (see Rickard's sig wink). Much preferred would be agnostic, forward-looking URI structures such as:

http://punbb.org/forums/forum/40/
http://punbb.org/forums/topic/6254/
http://punbb.org/forums/post/34299/

In addition, it would be nice if an optional custom URI function were available for the places that make sense. For example, an additional field in the forums table called "forum_uri" could store the bit to append to the forum URI. Using this option would, for example, produce forum URIs that look like:

http://punbb.org/forums/forum/news/
http://punbb.org/forums/forum/reports/
http://punbb.org/forums/forum/requests/
http://punbb.org/forums/forum/troubleshooting/

...etc.

I would like to also take this opportunity to mention what I believe would be one of the best bang-for-buck feature additions to PunBB: ubiquitous feeds. Both per forum and per topic, in RSS and Atom. Following the same URI philosophy noted above, these might look like:

http://punbb.org/forums/forum/40/feed/rss/
http://punbb.org/forums/forum/news/feed/rss/
http://punbb.org/forums/topic/6254/feed/atom/

The "price" to implement this should be very low, both in development time and code complexity. It would add enormous functionality without adding any bloat.

Of course, if extern.php already has the ability to generate per-topic feeds (it doesn't appear to, but I could be wrong), then all that would be needed is to perform the same URI magic as the forum, topic, and post URI structures.

If you would like to see where this has been done extremely well, look no further than WordPress (incidentally, WordPress 1.5 was just released today). WordPress has ubitquitous feeds in a clean URI structure: just tack on /feed/ to almost any URI to produce an XML feed. Brilliant.

Thanks for listening. I look forward to your feedback!

Justin


Aside:

It's easy to see the sense in allowing for semantic URIs for forums. Creating semantic URIs for topics and posts (without any IDs), on the other hand, would probably be difficult due to the need for them to be unique. But semantic data could be appended to the end of the ID if a "slug" field were available to folks when creating new topics or posts, producing URIs such as the following:

http://punbb.org/forums/topic/6254/clean-uris/
http://punbb.org/forums/post/34299/permanence-is-key/

In this scenario, the code would display -- but internally ignore -- the appended slug, grabbing instead what it needs from the preceding information in the URI (e.g., "topic" and "6254").

Re: Feedback wanted on URL rewriting thing

maybe its better to let the idea that your going to have "idless" URIs die, adding a extra pointless bit to the end is pointless, it makes these tidier links more messy, and what happens when people use "dodgy" characters? its just not worth it

11

Re: Feedback wanted on URL rewriting thing

Connorhd wrote:

maybe its better to let the idea that your going to have "idless" URIs die

I can understand the argument that ID-less URIs for topics and posts imay not be realistic, which is consistent with what I already wrote above. For forums, however, I can think of no reason not to provide the admin with the option to use a unique string in place of the forum ID.

adding a extra pointless bit to the end is pointless

1. What is pointless to some may not be pointless to others.
2. Semantic URIs improve readability and may improve search engine index relevancy.
3. Semantic URIs for topics and posts are, as I mentioned above, more difficult to implement. That's why I added that as an aside instead of including it in the main thrust of my post. The idea was to bring up what might be possible in the pursuit of more semantic URIs. The main portion of my post is where I believe the most valuable suggestions lie. The aside was more along the lines of "food for thought."

what happens when people use "dodgy" characters?

They get sanitized or discarded. End of problem.

Re: Feedback wanted on URL rewriting thing

but aside from the search engine stuff the idea of this is to make the URIs tidy (unless i'm totally missing this) and therefore making them longer doesn't make sense to me

They get sanitized or discarded. End of problem.

you'll be lucky if its that simple wink

Re: Feedback wanted on URL rewriting thing

Justin: I'm no longer considering it, I've decided to implement it. It won't show up until PunBB 1.3 though.

Regarding ambiguous feeds. Adding support for per-topic feeds to extern.php is already on the list and I like the idea of just being able to append /feed/[type]/ to the end of the URL. I will seriously consider this. I have to honest though, I have never ever played with URL rewriting so my knowledge of what's possible is very limited. I will get with the program and install mod_rewrite on my dev server as soon as possible. I'm guessing the ambiguous feed thing could be realized without actually adding one single line of code to index.php, viewforum.php and/or viewtopic.php. If that's the case, consider it done.

I hear what you're saying regarding forum URIs and I will consider it. However, in my experience, people don't link directly to individual forums that often. Almost all links to a forum or within a forum are links to individual topics or posts. Don't you agree?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Feedback wanted on URL rewriting thing

well with the function you said, and mod_rewrite (aside from text instead of ids) pretty much anything you want would be possible

15

Re: Feedback wanted on URL rewriting thing

Rickard wrote:

Justin: I'm no longer considering it, I've decided to implement it. It won't show up until PunBB 1.3 though.

This is good news, I have one suggestion.

Whatever is implemented, it would be nice to still be able to access the links the old way or else an upgrade to 1.3 and turning on this feature would produce 404's for existing links.

Re: Feedback wanted on URL rewriting thing

no it wouldn't, the actual URLs stay the same, its just the links on the pages that change, then apache rewrites them to the old ones, so the old links would still be valid

17

Re: Feedback wanted on URL rewriting thing

Rickard wrote:

Justin: I'm no longer considering it, I've decided to implement it. It won't show up until PunBB 1.3 though.

Very excited to hear that, Rickard. I would love to help you test this as soon as you are ready. I have no fewer than three site launches that are on hold until I can implement the above-mentioned URI permanence for them. wink

I have to honest though, I have never ever played with URL rewriting so my knowledge of what's possible is very limited.

That shouldn't be a problem. Once the PunBB code outputs the custom link URIs, the mod_rewrite rules are just a few lines of regular expressions and shouldn't take more than an hour or two to write (if that). As I mentioned before, I highly recommend taking a look at the WordPress 1.5 code and re-write rules. They did a great job. That said, maybe you should take a crack at it first and then compare; you might come up with an even more elegant solution. smile

I hear what you're saying regarding forum URIs and I will consider it. However, in my experience, people don't link directly to individual forums that often. Almost all links to a forum or within a forum are links to individual topics or posts. Don't you agree?

Yes, you are quite right -- most people link directly to individual topics or posts. I just thought it would be a nice option for some folks, but by no means as valuable as the other points under discussion.

Looking forward to receiving the first bit of code to test... big_smile

Re: Feedback wanted on URL rewriting thing

I suggest you take a look at the Wikipedia source - they do a fine job of using mod_rewrite to make nice urls.

Re: Feedback wanted on URL rewriting thing

Rickard wrote:

Justin: I'm no longer considering it, I've decided to implement it. It won't show up until PunBB 1.3 though.

Good news. Please please please think about localization while you implement it (the ability to edit the names in the URI to match a language other than english).

I hear what you're saying regarding forum URIs and I will consider it. However, in my experience, people don't link directly to individual forums that often. Almost all links to a forum or within a forum are links to individual topics or posts. Don't you agree?

In small forums yes. Not in big ones. Look at these for example http://forums.jeuxonline.info/
Not only its customary to link to a single forum, but it is too to link to a category of forums. And more, there have links to navigate from one forum to the other into each category (http://forums.jeuxonline.info/forumdisp … orumid=260 , just after the breadcrumb) and this function was added by popular demand of the users.

Re: Feedback wanted on URL rewriting thing

I've been playing around with this a bit tonight (my first encounter with mod_rewrite) and this is what I've come up with so far:

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /upload/

RewriteRule ^forum/([0-9]+)/?$ viewforum.php?id=$1 [L]
RewriteRule ^forum/([0-9]+)/rss/?$ extern.php?action=active&fid=$1&type=RSS [L]
RewriteRule ^topic/([0-9]+)/?$ viewtopic.php?id=$1 [L]
#RewriteRule ^topic/([0-9]+)/rss/?$ extern.php?action=topic&tid=$1&type=RSS [L]
RewriteRule ^post/([0-9]+)/?$ viewtopic.php?pid=$1 [L]
RewriteRule ^post/([0-9]+)/?\#p([0-9]+)$ viewtopic.php?pid=$1#p$2 [L]
RewriteRule ^profile/([0-9]+)/?$ profile.php?id=$1 [L]

</IfModule>

It's far from done. I intend to add rules for all of PunBB PHP scripts. However, before I continue, I have a question. If I access e.g. /punbb/forum/21/ and the URL gets rewritten to /punbb/viewforum.php?id=21, the actual PHP script is executed just fine, but a problem appears for the CSS includes. The browser doesn't understand that we are actually in /punbb/ and not in /punbb/forum/21/ and subsequently, tries to fetch /punbb/forum/21/style/Oxygen.css. Any ideas on how to circumvent that?

Also, I would appreciate any general comments you have on this. Like I said before, I've never worked with mod_rewrite before.

Edit: Another question. In Wordpress, you append e.g. /feed/rss/ or /feed/atom/ to the end of an URL to access the feed. Is there any reason why that is preferable to just /rss/ or /atom/ ?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Feedback wanted on URL rewriting thing

for the css maybe you could add

RewriteRule ^.*/.*/(.*)\.css?$ $1.css [L]

or something similar to rewrite it back if that makes sense, another thing you can do (which may or may not be useful here) is rewrite *.php to loader.php then let loader.php do all the thinking (if mod_rewrite is not powerful enough)

22

Re: Feedback wanted on URL rewriting thing

Hooray. Nearly identical to my setup. It has to be good. wink

As for the CSS issues, the base tag is what you need. In my case, I just put the full URL in there, and that makes things work nicely, but it adds far more dependance on the URL of the site being correct than you may want. But doing something with that tag should alleviate your problems.

The only other thing you might want to do is make all of those [NC, L] rather than just [L]. So everything is case insensitive and whatnot, but that's not a huge deal.

I'm also not quite sure RewriteBase is necessary, but I've never been able to figure out it's use.

/feed/atom vs /atom. I like /atom. Structurally it make sense, so feed seems a tad superfluous.

Hard work may not kill you, but why take chances?

Re: Feedback wanted on URL rewriting thing

Connorhd wrote:

for the css maybe you could add

RewriteRule ^.*/.*/(.*)\.css?$ $1.css [L]

Yes, it just feels like a hack.

GUI wrote:

Hooray. Nearly identical to my setup. It has to be good. wink

Haha, I wouldn't be so sure smile

GUI wrote:

As for the CSS issues, the base tag is what you need. In my case, I just put the full URL in there, and that makes things work nicely, but it adds far more dependance on the URL of the site being correct than you may want. But doing something with that tag should alleviate your problems.

Yes, I considered it. Either that or having the absolute URL to the style sheet.

GUI wrote:

The only other thing you might want to do is make all of those [NC, L] rather than just [L]. So everything is case insensitive and whatnot, but that's not a huge deal.

Noted.

GUI wrote:

I'm also not quite sure RewriteBase is necessary, but I've never been able to figure out it's use.

It's simply prepended to all the patterns. You need it if your forums are in a subdirectory somewhere and you don't want to add the subdirectory to every rule. Problem is, people will have to edit it themselves.

GUI wrote:

/feed/atom vs /atom. I like /atom. Structurally it make sense, so feed seems a tad superfluous.

I agree. I thought maybe /feed/atom/ made more sense semantically or something, but personally, I don't think so.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

24

Re: Feedback wanted on URL rewriting thing

Great work so far, Rickard. Bravo! big_smile

Rickard wrote:

If I access e.g. /punbb/forum/21/ and the URL gets rewritten to /punbb/viewforum.php?id=21, the actual PHP script is executed just fine, but a problem appears for the CSS includes.

While I'm quite familiar with mod_rewrite from the admin side of things, I know very little about the actual code generation. I'll see if I can get some feedback from those who can provide it better than I.

In Wordpress, you append e.g. /feed/rss/ or /feed/atom/ to the end of an URL to access the feed. Is there any reason why that is preferable to just /rss/ or /atom/ ?

The rewrite rules that WordPress generates are very flexible and will look for any of the combinations you mentioned above. For example, tacking the following onto the end of WordPress URIs will output the following XML feed formats:

/feed/            ->          RSS 2.0
/feed/rss/       ->          RSS 0.92
/feed/rss2/      ->         RSS 2.0
/feed/atom/    ->          Atom
/rss/              ->          RSS 0.92
/rss2/            ->          RSS 2.0
/atom/           ->          Atom

As for how PunBB presents the links, ideally this should be configurable, such that the admin interface presents two options: no directory preceding the feed format, or a custom-entered directory name (feed, feeds, newsfeeds, xml, etc).

For your reference, I'm including below some rewrite rules that were generated by WordPress 1.5. The way this works is that you specify what you want the URI structure to look like in the admin interface, and then WordPress generates the rewrite rules corresponding to the entered template. For the purposes of this illustration, I used /forums/ as the base URI and entered the following as the URI structure:

/post/%post_id%/

WordPress then generated the rewrite rules below. While this obviously doesn't apply directly (WordPress isn't for forums smile), hopefully this will be of some use as a reference point. Let me know what you think.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /forums/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [S=35]
RewriteRule ^feed/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?&feed=$1 [QSA,L]
RewriteRule ^(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?&feed=$1 [QSA,L]
RewriteRule ^page/?([0-9]{1,})/?$ /forums/index.php?&paged=$1 [QSA,L]
RewriteRule ^comments/feed/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?&feed=$1&withcomments=1 [QSA,L]
RewriteRule ^comments/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?&feed=$1&withcomments=1 [QSA,L]
RewriteRule ^comments/page/?([0-9]{1,})/?$ /forums/index.php?&paged=$1 [QSA,L]
RewriteRule ^search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?s=$1&feed=$2 [QSA,L]
RewriteRule ^search/(.+)/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?s=$1&feed=$2 [QSA,L]
RewriteRule ^search/(.+)/page/?([0-9]{1,})/?$ /forums/index.php?s=$1&paged=$2 [QSA,L]
RewriteRule ^search/(.+)/?$ /forums/index.php?s=$1 [QSA,L]
RewriteRule ^post/category/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?category_name=$1&feed=$2 [QSA,L]
RewriteRule ^post/category/(.+)/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?category_name=$1&feed=$2 [QSA,L]
RewriteRule ^post/category/(.+)/page/?([0-9]{1,})/?$ /forums/index.php?category_name=$1&paged=$2 [QSA,L]
RewriteRule ^post/category/(.+)/?$ /forums/index.php?category_name=$1 [QSA,L]
RewriteRule ^post/author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?author_name=$1&feed=$2 [QSA,L]
RewriteRule ^post/author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?author_name=$1&feed=$2 [QSA,L]
RewriteRule ^post/author/([^/]+)/page/?([0-9]{1,})/?$ /forums/index.php?author_name=$1&paged=$2 [QSA,L]
RewriteRule ^post/author/([^/]+)/?$ /forums/index.php?author_name=$1 [QSA,L]
RewriteRule ^post/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?year=$1&monthnum=$2&day=$3&feed=$4 [QSA,L]
RewriteRule ^post/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?year=$1&monthnum=$2&day=$3&feed=$4 [QSA,L]
RewriteRule ^post/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$ /forums/index.php?year=$1&monthnum=$2&day=$3&paged=$4 [QSA,L]
RewriteRule ^post/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /forums/index.php?year=$1&monthnum=$2&day=$3 [QSA,L]
RewriteRule ^post/date/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?year=$1&monthnum=$2&feed=$3 [QSA,L]
RewriteRule ^post/date/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?year=$1&monthnum=$2&feed=$3 [QSA,L]
RewriteRule ^post/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$ /forums/index.php?year=$1&monthnum=$2&paged=$3 [QSA,L]
RewriteRule ^post/date/([0-9]{4})/([0-9]{1,2})/?$ /forums/index.php?year=$1&monthnum=$2 [QSA,L]
RewriteRule ^post/date/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?year=$1&feed=$2 [QSA,L]
RewriteRule ^post/date/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?year=$1&feed=$2 [QSA,L]
RewriteRule ^post/date/([0-9]{4})/page/?([0-9]{1,})/?$ /forums/index.php?year=$1&paged=$2 [QSA,L]
RewriteRule ^post/date/([0-9]{4})/?$ /forums/index.php?year=$1 [QSA,L]
RewriteRule ^post/([0-9]+)/trackback/?$ /forums/index.php?p=$1&tb=1 [QSA,L]
RewriteRule ^post/([0-9]+)/feed/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?p=$1&feed=$2 [QSA,L]
RewriteRule ^post/([0-9]+)/(feed|rdf|rss|rss2|atom)/?$ /forums/index.php?p=$1&feed=$2 [QSA,L]
RewriteRule ^post/([0-9]+)/page/?([0-9]{1,})/?$ /forums/index.php?p=$1&paged=$2 [QSA,L]
RewriteRule ^post/([0-9]+)/?([0-9]+)?/?$ /forums/index.php?p=$1&page=$2 [QSA,L]
</IfModule>

25

Re: Feedback wanted on URL rewriting thing

Rickard, this is an explanation of how Nucleus does it's URL building.

Might be of some help: http://karma.nucleuscms.org/item/23/