In case of using Apache and having mod_rewrite
activated, try this one in your .htaccess
file at the flarum root level:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{ENV:HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.teknikforum\.com [NC]
RewriteRule ^viewtopic\.php\?f=\d+&t=(\d+)$ https://www.teknikforum.com/d/$1 [R=301,L]
</IfModule>
Not being able to test this, I hope, I haven't overlooked something. Should mod_rewrite
not be activated on your server, the above will not do anything, it won't throw an error either.
Hope this helps.