Is there a way to put a small rewriterule in .htaccess to redirect over 20.000 links from an old phpBB based forum to a new phpBB forum? The old link is like this :
https://example.com/t123456-some-title
The new link is like this :
https://example.com/forum/viewtopic.php?t=123456
t-123456 is a variable number for topic number in the old forum, and the number is the same but with viewtopic.php?t=123456
I think that is possible with some regex, but I don't know how to make this.
Maybe something like :
RewriteEngine On
RewriteBase /
RewriteRule ^t-([0-9]+)-([a-zA-Z0-9-]+)$ /forum/viewtopic.php?t=$2 [R,L]
Big thanks to @MrWhite, the rewriterule work perfectly.
RewriteRule ^t(\d+) /forum/viewtopic.php?t=$1 [R=301,L]