# Redirect Category to External URL

**URL:** https://meta.discourse.org/t/redirect-category-to-external-url/85691
**Category:** Support
**Created:** [4월 19, 2018, 5:32오전 UTC](https://meta.discourse.org/t/redirect-category-to-external-url/85691 "2018-04-19T05:32:29Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![Cameron\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cameron_d/32/97535_2.png) [@Cameron\_D](https://meta.discourse.org/u/Cameron_D)
#### Post date: [4월 20, 2018, 4:45오전 UTC](https://meta.discourse.org/t/redirect-category-to-external-url/85691/7 "2018-04-20T04:45:06Z")

</div>

> [@Zyniker](#):
>
> Is there some quirk in Discourse that would cause this redirect not to trigger?

Yes, being a single-page-app the page only loads once, subsequent loads just replace the page contents. There is a page change API you can hook into:

> [@How do you force a script to refire on every page load in Discourse?](https://meta.discourse.org/t/how-do-you-force-a-script-to-refire-on-every-page-load-in-discourse/74856/5):
>
> I think you can use the PluginAPI onPageChange function to do what you are looking for. See: [Using the PluginAPI in Site Customizations](https://meta.discourse.org/t/using-the-pluginapi-in-site-customizations/41281) Here’s an example function: \<script type="text/discourse-plugin" version="0.8"\> api.onPageChange(() =\>{ randBackground(); }); function randBackground() { $('body').css('background-color', '#'+(Math.random()\*0xFFFFFF\<\<0).toString(16)); } \</script\> Update: If you are looking to apply similar changes to post bodies, see [post…](https://meta.discourse.org/t/how-do-you-force-a-script-to-refire-on-every-page-load-in-discourse/74856/26)

---

_[View the full topic](https://meta.discourse.org/t/redirect-category-to-external-url/85691)._
