I want to redirect as above, but I couldn’t find the nginx folder. I would be glad if you help.
Also, if you can share the regex codes, I would appreciate it
Did you do a standard install or is flarum running on the same host as Discourse?
Did you use the flarum migration script to import your data? It doesn’t look like the flarum script handles permalink redirects. I cannot imagine how the redirect you suggest could possible work unless you have somehow contrived for the topic IDs in Discourse to match those in flarum.
If you somehow did that, there is a permalink normalization site setting that will do what you suggest. It would be something like
/d\/(\d+)-(.*)/t\/\2\/\1/
But the asdasd section can be replaced with a -, as the slug is ignored for routing.
nginx is inside the docker container. You can see it if you
cd /var/discourse
./launcher enter app
changes that you make there will be destroyed when you build a new container. It’s possible to make changes to your app.yml that will modify the nginx config in the container when a new one is built. You can look at the templates in /var/discourse/templates for some examples.
It’s almost certainly going to be quicker to investigate and compare to the other importer scripts and attempt to implement than it will be to create 150,000 redirects manually.
Then you need to modify or pay someone to modify the import script to make the permalinks. What you are trying to do is impossible. The topic ids are all different. If you have users already using the community now you’re either out of luck or will need to throw away their posts.
Oh. Sorry. The import_ids should be in the database. You can write a script to create the permalinks. You’ll need to look at some of the other import scripts for one that creates the redirects after the topics are imported rather than as part of the import topic function.
Sometimes it’s hard to get the right slug for various reasons. You can usually do something clever with permalink_normalizations to ignore the slug and pay attention only to the ID in the Permalink.