# Redirect from Discourse to Outside

**URL:** https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812
**Category:** Support
**Created:** [April 13, 2020, 2:42pm UTC](https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812 "2020-04-13T14:42:16Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)
#### Post date: [April 13, 2020, 2:42pm UTC](https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812/1 "2020-04-13T14:42:17Z")

</div>

Hello

Old URL

```plaintext
https://discourse.example.com/t/tiles-image-gallery/81950

```

HTTP Status Code: 301 ⬇

New URL

```plaintext
https://example.com/tiles-image-gallery/

```

HTTP Status: 200

How can I setup redirect like this?

Thanks

---

<div class="post-metadata">

### Author: ![zcuric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zcuric/32/292837_2.png) [@zcuric](https://meta.discourse.org/u/zcuric)
#### Post date: [April 13, 2020, 9:24pm UTC](https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812/2 "2020-04-13T21:24:20Z")

</div>

Hi, try Settings \> Customize \> Permalinks

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 13, 2020, 10:34pm UTC](https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812/3 "2020-04-13T22:34:25Z")

</div>

Permalinks redirect inbound links to internal pages. If you’re migrating from a different platform you use them to catch old addresses to direct users to new addresses.

I’m not aware of anything within Discourse that will handle redirecting discourse URLs externally.

To clarify though, are you looking to redirect traffic, or just rewrite?

---

<div class="post-metadata">

### Author: ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)
#### Post date: [April 13, 2020, 10:58pm UTC](https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812/5 "2020-04-13T22:58:51Z")

</div>

I need to make some external redirect.

Discourse is hosted at A subdomain

WordPress is hosted at A apex domain

Both are separated hostname, and need to exist.

* * *

I just want to redirect couple of topics from Discourse to WordPress blog post.

Both Permalink is different.

When I go to Discourse customize \> permalink it doesn’t seems providing simple

from

And

To

Field which could have been easier to make redirect wherever I want.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 13, 2020, 11:01pm UTC](https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812/6 "2020-04-13T23:01:48Z")

</div>

> [@Stephen](#):
>
> I’m not aware of anything within Discourse that will handle redirecting discourse URLs externally.

You can use permalinks to redirect to outside URLs just fine.

Example: [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](http://meta.discourse.org/guide)

---

<div class="post-metadata">

### Author: ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)
#### Post date: [April 13, 2020, 11:02pm UTC](https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812/7 "2020-04-13T23:02:51Z")

</div>

How this is possible, can you please provide me a screenshot how it can be done?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 13, 2020, 11:11pm UTC](https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812/8 "2020-04-13T23:11:48Z")

</div>

It’s exactly where @zcuric told you:

> [@zcuric](#):
>
> Hi, try Settings \> Customize \> Permalinks

As you can see on my example it redirect a simple path, `guide` in the example, to an external URL.

I’m not sure it’s possible to do it with a URL that matches a topic path. That is not a common use case.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [April 13, 2020, 11:23pm UTC](https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812/9 "2020-04-13T23:23:01Z")

</div>

> [@Falco](#):
>
> I’m not sure it’s possible to do it with a URL that matches a topic path. That is not a common use case.

Yes, I don’t believe it will work with a topic URL, or any other URL that Discourse normally responds to. Try undeleting the topic, deleting all its replies, and replacing the first post with some text directing people towards a link to the applicable external website.

---

<div class="post-metadata">

### Author: ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)
#### Post date: [April 13, 2020, 11:24pm UTC](https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812/10 "2020-04-13T23:24:00Z")

</div>

Exactly, it caches simple redirect only for example if I set

```plaintext
/twitterdev

```

to

```plaintext
https://twitter.com/twitterdev

```

This works.

But I want to do Topic to External… where it doesn’t go external path.

From

```plaintext
https://discourse.example.com/t/tiles-image-gallery/(.*)

```

(I have added wildcard to match paginated URLs)

301 To my external application WordPress post permalink

```plaintext
https://example.com/tiles-image-gallery/

```

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [April 14, 2020, 8:37pm UTC](https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812/14 "2020-04-14T20:37:58Z")

</div>

> [@Gulshan\_Kumar](#):
>
> But I want to do Topic to External… where it doesn’t go external path.

`discourse.example.com` redirecting to `example.com` is “external”. It is a different domain; “external” in this context is _any_ domain not exactly  
`discourse.example.com`.

> [@Gulshan\_Kumar](#):
>
> [https://discourse.example.com/t/tiles-image-gallery/(.\*)](https://discourse.example.com/t/tiles-image-gallery/(.*))

Wildcard support isn’t a feature I’d expect in the redirects; they are meant for simple one off page things.

> [@Gulshan\_Kumar](#):
>
> (I have added wildcard to match paginated URLs)

I would ask myself if folks go to paginated URLs; in my experience they do not.

I’d say you are good to go. 🙂

---

<div class="post-metadata">

### Author: ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)
#### Post date: [April 15, 2020, 7:36pm UTC](https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812/15 "2020-04-15T19:36:45Z")

</div>

I am thinking from the search engines prospective where 301 is important.

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [April 15, 2020, 10:13pm UTC](https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812/16 "2020-04-15T22:13:25Z")

</div>

I’m not a search engine, I wouldn’t know. 🤔

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 19, 2024, 2:34am UTC](https://meta.discourse.org/t/redirect-from-discourse-to-outside/147812/17 "2024-05-19T02:34:32Z")

</div>


