The sample assumes that you’ll do the redirects on the old server, not the Discourse server.
If your discourse server is using the same name as your old server, you want to use permalink redirects, and perhaps permalink normalizations in discourse.
For those who do not have MAP or can’t figure it out, I have figured out the easy (dumb) way to do it for topics at least. This works for VBulletin 4. I have not tested on 5 nor do a really want to deal with VBulletin ever again, so I probably won’t. I think the URL structure is the same though. This is for migrating from VBulletin 4 (hosted on NGINX) to Discourse (also hosted on NGINX).
*** Note, there are security implications with this process, but if you are new to NGINX (like I am) and just need to get this done and then figure out the fancy way later, this is what I did. In short, it requires you to keep your old vbulletin running for a while *****
Change your VBulletin URLs to “Advanced Friendly URLs” >Admin>Settings>Options>Friendly URLS. This will get rid of the argument character “?” in all your urls. All the destination posts will be at “…showthread.php/(the-post-id-number)-blablablabla…” Old urls with google juice will forward to the new urls. Don’t worry.
Now import your vbulletin and make sure that you uncomment the permalinks section (as described in this thread).
After import, open the vb_map.csv. You will see post to post (ID to ID) maps like xxxx837 yyyy589. The first is the ID of the VB thread and second is the ID of the Discourse thread.
The “-” is key in this whole equation so remember to put it in there. A simple txt editor with “find-replace” will convert the map file to nginx rewrite directives.
Nginx seems to be able to handle several thousand rewrites (or several hundred thousand as the case may be). I have seen no performance issues so far.
On a further note, it took me FOREVER to figure out how to simply replace a question mark with a forward slash in NGINX. Maybe I’m dumb (no I’m certainly dumb), but the above little snippet works like a charm and I don’t see it widely documented elsewhere.