Issue with permalink normalizations

Hi fellow Discourse users,

I migrated a big bbPress forum to Discourse, which works great. However there are many 404 errors which seem to come from indexed pages on Google. This seems to be related to paged topics.

Old url style: https://forum.xxx.nl/t/---topicname---/page/33/ (bbPress style)
New url style: https://forum.xxx.nl/t/---topicname---?page=33 (Discourse style)

I thought this could be fixed with permalink normalizations. So I added the following regex /(t\/[^\/]*)\/page\/(\d+)\/?/\1?page=\2. However nothing seems to happen. The bbPress style urls still show a 404 and don’t seem to be normalized.

Am I doing something wrong, or are permalink normalizations the wrong tool for the job? Any input is appreciated. Many thanks!

That’s not a correct Discourse URL, that would be

New url style: https://forum.xxx.nl/t/---topicname---/TOPICID?page=33 (Discourse style)

And you would need a mapping from bbPress topic slug / page number to Discourse topic ID’s / post numbers.

A mapping from bbPress topic slug to Discourse topic ID is included in the importer, so you would need to expand on those. That would imply some code to create extra (Post) permalinks based on the existing topic permalinks.

So for instance if /t/blah maps to topic #123 then

/t/blah/page/2 would map to /t/slug/123/20
/t/blah/page/3 would map to /t/slug/123/40

and so on.