# Correct way to add rewrite rules to Nginx

**URL:** <https://meta.discourse.org/t/correct-way-to-add-rewrite-rules-to-nginx/24679>\
**Category:** Self-hosting\
**Created:** [2015年二月1日 14:15 UTC](https://meta.discourse.org/t/correct-way-to-add-rewrite-rules-to-nginx/24679 "2015-02-01T14:15:59Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2015年二月1日 20:58 UTC](https://meta.discourse.org/t/correct-way-to-add-rewrite-rules-to-nginx/24679/4 "2015-02-01T20:58:04Z")

</div>

Yeah, for that there is this howto

> [@Redirect old forum URLs to new Discourse URLs using permalinks](https://meta.discourse.org/t/redirecting-old-forum-urls-to-new-discourse-urls/20930):
>
> Redirecting Old Forum URLs to New Discourse URLs using permalinks If you’ve moved from other forum software to Discourse using [one of our import scripts](https://github.com/discourse/discourse/tree/main/script/import_scripts), then you probably want all your hard-earned Google search results to continue pointing to the same content. Discourse has a built-in way to handle this for you as an alternative to writing nginx rules, using the permalinks lookup table. The permalinks table allows you to set two things: a url to match, and what that url should show. There a…

---

_[View the full topic](https://meta.discourse.org/t/correct-way-to-add-rewrite-rules-to-nginx/24679)._
