# Redirect URL with Nginx in Digital Ocean

**URL:** <https://meta.discourse.org/t/redirect-url-with-nginx-in-digital-ocean/235297>\
**Category:** Self-hosting\
**Created:** [August 6, 2022, 9:10am UTC](https://meta.discourse.org/t/redirect-url-with-nginx-in-digital-ocean/235297 "2022-08-06T09:10:28Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [August 6, 2022, 11:36am UTC](https://meta.discourse.org/t/redirect-url-with-nginx-in-digital-ocean/235297/2 "2022-08-06T11:36:02Z")

</div>

Did you do a [standard install](https://meta.discourse.org/t/142537?silent=true) 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

```plaintext
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.

---

_[View the full topic](https://meta.discourse.org/t/redirect-url-with-nginx-in-digital-ocean/235297)._
