# Hoe kan ik dynamische redirects gebruiken?

**URL:** <https://meta.discourse.org/t/how-can-i-use-dynamic-redirects/172952>\
**Category:** Self-hosting\
**Created:** [11 december 2020 om 07:06 UTC](https://meta.discourse.org/t/how-can-i-use-dynamic-redirects/172952 "2020-12-11T07:06:02Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [11 december 2020 om 19:39 UTC](https://meta.discourse.org/t/how-can-i-use-dynamic-redirects/172952/4 "2020-12-11T19:39:30Z")

</div>

You can add stuff to your `app.yml` to modify the nginx config (or run an external one). I’m not sure where best to send you. Here’s an example of making some changes to the nginx config for another purpose:

```plaintext
  after_ssl:
   # do not redirect all hosts back to the main domain name
    - replace:
        filename: "/etc/nginx/conf.d/discourse.conf"
        from: /if \(\$http_host[^\}]*\}/m
        to: ""
    - replace:
        filename: "/etc/nginx/conf.d/discourse.conf"
        from: /return 301.*$/
        to: "return 301 https://$host$request_uri;"

```

---

_[View the full topic](https://meta.discourse.org/t/how-can-i-use-dynamic-redirects/172952)._
