HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Redirect old URLs from PunBB to Vanilla
labastro
New
Hello.
I'm trying to redirect old URLs from a PunBB board with custom paths, but I can't do it.
I tried the following code in htaccess, but it does not work :
RedirectMatch permanent /topic(.*) https://www.example.net/discussion/$1/
My old URLs use the following pattern:
https://www.example.net/topic123-keyword.html
Thank you for your help.
0
Comments
As far as I understand it, in the pattern
/topic(.*)
the (.*) would match everything behind "/topic" when everything you need is the number. For Vanilla both links below are the samehttps://open.vanillaforums.com/discussion/37873/redirect-old-urls-from-punbb-to-vanilla
https://open.vanillaforums.com/discussion/37873
try something like
/topic(\d*).*
insteadYes, it works!
Thanks a lot.
Have you tried the Redirector plugin? I'm pretty sure it has PunBB support builtin.
Hi.
Yes, I had tried. But this plugin seems to work only with unwritten urls (= viewtopic.php?id=...).
RewriteEngine On
RewriteRule ^topic(\d+)-(.+)\.html$ https://www.example.net/discussion/$1-$2 [R=301,L]
You can simulate your URL on any online tool such as https://redirectchecker.com/ to get detail redirection chain step by step.