diff --git a/e107_plugins/forum/e_url.php b/e107_plugins/forum/e_url.php index f684e7f11f..cfaee9bfb7 100644 --- a/e107_plugins/forum/e_url.php +++ b/e107_plugins/forum/e_url.php @@ -86,6 +86,13 @@ function config() 'sef' => 'forum/{forum_sef}/{thread_id}/{thread_sef}/', 'redirect' => '{e_PLUGIN}forum/forum_viewtopic.php?id=$2&$4' ); + + $config['topic-canonical'] = array( + 'regex' => 'forum\/([^\/]*)\/([\d]*)(?:\/|-)([\w-]*)/?\??(.*)', + // 'regex' => '^forum/(.*)/(\d*)(?:-|/)([\w-]*)/?\??(.*)', + 'sef' => 'forum/{forum_sef}/{thread_id}/?p={thread_page}', + 'redirect' => '{e_PLUGIN}forum/forum_viewtopic.php?id=$2&$4' + ); /* $config['subforum'] = array( 'regex' => '^forum/(.*)/(.*)$', diff --git a/e107_plugins/forum/forum_viewtopic.php b/e107_plugins/forum/forum_viewtopic.php index e2994d468f..739070b675 100644 --- a/e107_plugins/forum/forum_viewtopic.php +++ b/e107_plugins/forum/forum_viewtopic.php @@ -376,8 +376,10 @@ e107::getDebug()->log($ret); unset($ret); } + +$thread->threadInfo['thread_page'] = varset($thread->page,1); +e107::canonical('forum', 'topic-canonical', $thread->threadInfo); -e107::canonical('forum', 'topic', $thread->threadInfo); require_once (HEADERF);