# 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:** 6

<div class="post-metadata">

**Author:** ![wilson29thid](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wilson29thid/32/173700_2.png) [@wilson29thid](https://meta.discourse.org/u/wilson29thid)\
**Post date:** [12 december 2020 om 11:53 UTC](https://meta.discourse.org/t/how-can-i-use-dynamic-redirects/172952/6 "2020-12-12T11:53:54Z")

</div>

For anyone else landing here, I implemented this by SSHing into my server, navigating to `/var/discourse`, opening `containers/app.yml` with vim and scrolling down to the `hooks` section. I then added this bit:

```yaml
hooks: # this line should already be there
  after_ssl:
    - replace:
        filename: "/etc/nginx/conf.d/discourse.conf"
        from: "location @discourse {"
        to: |
          location /discussion/ {
            return 301 https://vanilla.29th.org$request_uri;
          }

          location @discourse {
  after_code: # this line should already be there

```

---

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