1

(10 replies, posted in PunBB 1.3 discussion)

I found a better solution. All you need is an extension with the following hooks:

1) Hook vf_modify_forum_info

$seo_url = forum_sublink($forum_url['forum'], $forum_url['page'], (isset($_GET['p']) ? $_GET['p'] : 1), array($id, sef_friendly($cur_forum['forum_name'])));
if ($seo_url !== get_current_url())
    header('Location:'.$seo_url, true, 301);

2) Hook vt_modify_topic_info

$seo_url = forum_sublink($forum_url['topic'], $forum_url['page'], (isset($_GET['p']) ? $_GET['p'] : 1), array($id, sef_friendly($cur_topic['subject'])));
if ($seo_url !== get_current_url() && !$pid)
    header('Location:'.$seo_url, true, 301);

This method is better because:

1) You don't have to hack into punbb code.

2) It prevend duplicate content better, for ex. the following urls (in my website):
http://diendan.sile.vn/viewforum.php?id=36
http://diendan.sile.vn/forum/36
http://diendan.sile.vn/forum/36/abc
http://diendan.sile.vn/forum36-some-stu … words.html
....
all redirect to http://diendan.sile.vn/forum36-thu-thua … en-tu.html

Note that if you use fancy url scheme, you can cause duplicate contents when you rename your forum name or post title (for ex, http://diendan.sile.vn/forum36-some-stu … words.html and http://diendan.sile.vn/forum36-thu-thua … en-tu.html above). Using above hooks, only newest url is allowed, others will redirect to this url.

Hope it can help smile