Migrate a phpBB3 forum to Discourse

See SiteSettings.permalink_redirects

Edit: oops. Permalink normalizations

You mean at /admin/site_settings/category/all_results search for permalink_redirects? That setting does not exist for me.

But permalink_normalizations sort of works, using /^forum\/(view.*)/\1:

  • All phpBB links begin with view, like viewtopic.php and viewforum.php. Actually those seem to be the only two URLs migrated in our case, so the regex could be hardened, or split into two for full path matching.
  • So that regex (sed syntax) takes all URLs which start with /forum/view, and removes the forum/ part.

Now we only need to redirect all /phpbb/ (our old forum path) to /forum/ at the webserver (or Cloudflare in our case) and Discourse does the remains. Should have found this ~3 years ago, instead of breaking all backlinks :smiling_face_with_tear:.

But let me know where this permalink_redirects is supposed to be, maybe it requires a plugin, or was part of the phpBB import plugin or so?

EDIT: Works well:

root@micha:~# curl -IL https://dietpi.com/phpbb/viewtopic.php?p=46083
HTTP/2 301
location: /forum/viewtopic.php?p=46083

HTTP/2 301
location: https://dietpi.com/forum/t/is-there-a-simple-launch-page-for-dietpi/11237/1
x-discourse-route: permalinks/show

HTTP/2 200
x-discourse-route: topics/show

First redirect /phpbb => /forum happens at Cloudflare via redirect rule, to keep trivial load away from our origin. Second redirect to actual topic is done at Discourse via permalink, removing the leading forum/ via permalink normalization, to match the permalinks added by the phpBB import plugin, which contain neither old nor new forum sub directory path.

Sorry. That’s what I meant.

No. Just make a normalization for that path.