1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-30 01:08:46 +02:00

Merge pull request #4733 from Jimmi08/canonical-urls-on-topic-pages

Fixes #4712 canonical URLs for paged forum topic
This commit is contained in:
Cameron 2022-04-01 11:02:24 -07:00 committed by GitHub
commit 2d0e52c16a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -86,6 +86,13 @@ class forum_url // plugin-folder + '_url'
'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/(.*)/(.*)$',

View File

@ -375,8 +375,10 @@ else
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);