# Redirect to external site in a plugin?

**URL:** <https://meta.discourse.org/t/redirect-to-external-site-in-a-plugin/132932>\
**Category:** Development\
**Created:** [8 november 2019 om 15:30 UTC](https://meta.discourse.org/t/redirect-to-external-site-in-a-plugin/132932 "2019-11-08T15:30:46Z")\
**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:** [13 november 2019 om 01:00 UTC](https://meta.discourse.org/t/redirect-to-external-site-in-a-plugin/132932/2 "2019-11-13T01:00:33Z")

</div>

Sure there is something simple that I’m missing here. My latest incantation is to try

```plaintext
      url = thinkific_sso_url(payload)
      redirect_location = "<!DOCTYPE html><html><head><meta http-equiv=\"Refresh\" content = \"5; url='#{url}'\" /></head><body>This is my body</body></html>"
      Rails.logger.info "REDIRECTING... #{redirect_location}"

      render plain: redirect_location

```

If I save the text that is `redirect_location` to a file and open it in my browser, I get logged in to thinkific and I’m redirected to Discourse. Sadly, the same doesn’t work when I click login in my browser.

Can anyone throw me a bone?

---

_[View the full topic](https://meta.discourse.org/t/redirect-to-external-site-in-a-plugin/132932)._
