# How can I stop onebox redirection?

**URL:** https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515
**Category:** Feature
**Created:** [February 26, 2018, 6:31am UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515 "2018-02-26T06:31:27Z")
**Posts on this page:** 16
**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: [February 26, 2018, 6:31am UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/1 "2018-02-26T06:31:27Z")

</div>

Hello,

Consider a situation for an affiliate marketer..

where path `http://x.com/go/discourse/` is HTTP 301 to `https://discourse.org/ref=1` again HTTP 301 to `https://discourse.org/`

Problem is when I type first link, in onebox it automatically redirect to the final destination which is causing loss of revenue.

Please help me in disabling onebox and redirection for the specific path `http://x.com/go/*`

I want when I type `http://x.com/go/discourse/` link should be as it is without modification.

Thanks

---

<div class="post-metadata">

### Author: ![dje4321](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dje4321/32/78454_2.png) [@dje4321](https://meta.discourse.org/u/dje4321)
#### Post date: [February 26, 2018, 6:47am UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/2 "2018-02-26T06:47:03Z")

</div>

You should be able to goto `Admin -> Settings -> Onebox -> Onebox Domains Blacklist` to get the result you want

 ![Screenshot%20from%202018-02-26%2000-45-41](https://global.discourse-cdn.com/meta/original/3X/4/c/4c59eb12c9d4f298260af2bea0deeafa4b9f32bc.png)

---

<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: [February 26, 2018, 6:47am UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/3 "2018-02-26T06:47:33Z")

</div>

Thanks for the response.

I am sorry to inform, It’s not working. ☹

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [February 26, 2018, 12:41pm UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/5 "2018-02-26T12:41:01Z")

</div>

You haven’t entered a domain in the domain blacklist.

---

<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: [February 27, 2018, 6:29am UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/6 "2018-02-27T06:29:47Z")

</div>

Onebox Blacklist option is not working. Ref: video  
[https://www.useloom.com/share/f196f419ade04167b5e8a18b1c6f1126](https://www.useloom.com/share/f196f419ade04167b5e8a18b1c6f1126)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 27, 2018, 6:27pm UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/7 "2018-02-27T18:27:48Z")

</div>

Can you repro this @jomaxro?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [February 27, 2018, 9:21pm UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/9 "2018-02-27T21:21:47Z")

</div>

I can sort-of repro this.

Entering `meta.discourse.org` into `onebox domains blacklist` correctly prevents oneboxes of `meta.discourse.org` links. However, entering `gulshankumar.net` and `www.gulshankumar.net` into the setting does not prevent the oneboxing of `https://www.gulshankumar.net/go/sucuri-website-firewall`.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 27, 2018, 10:26pm UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/10 "2018-02-27T22:26:46Z")

</div>

Wait so the OP wants to prevent _SELF_ oneboxing? That’s really weird.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [February 27, 2018, 10:28pm UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/11 "2018-02-27T22:28:46Z")

</div>

`www.gulshankumar.net` isn’t an internal onebox. Discourse appears to be at `help.gulshankumar.net` - `www.gulshankumar.net` appears to be a WP site.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 27, 2018, 10:30pm UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/12 "2018-02-27T22:30:04Z")

</div>

Still this might be an unreasonable edge case if it is the same domain. Why wouldn’t you want to onebox your own stuff?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [February 27, 2018, 11:12pm UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/13 "2018-02-27T23:12:57Z")

</div>

I think the intent is to post referer links without them being obvious referer links but still have them be referer links.

For example, preserving the “u=mittineague” query string.  
`https://meta.discourse.org/t/how-can-i-stop-redirection/81515/12?u=mittineague`

I’m not certain about what kind of `RewriteRule` voodoo is going on or what domains are involved.

To me, the obvious solution would be to display the link as a link and not onebox it. eg.  
[https://meta.discourse.org/t/how-can-i-stop-redirection/81515/12?u=mittineague](https://meta.discourse.org/t/how-can-i-stop-redirection/81515/12)

---

<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: [February 28, 2018, 6:04am UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/14 "2018-02-28T06:04:47Z")

</div>

> [@codinghorror](#):
>
> Still this might be an unreasonable edge case if it is the same domain. Why wouldn’t you want to onebox your own stuff?

Hello,

I appreciate your curiosity, why I wouldn’t like Onebox. The major issue is redirection which happens due to Onebox.

Basically, to keep affiliate URLs short, memorable and easily managed at one place, I use redirection. I use Affiliate Link Lite plugin to convert ugly affiliate link to the branded form.

`https://www.gulshankumar.net/go/any-product-name/`

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/e/7e6ea7729fce248ced7faa57544c7e7562e30154.png)

What I am expecting, If I type my affiliate URL, Onebox shoudn’t display final destination instead of clocked path (which is /go/).

> [@Mittineague](#):
>
> I think the intent is to post referer links

Exactly. Thanks for understanding.

---

<div class="post-metadata">

### Author: ![knewt](https://avatars.discourse-cdn.com/v4/letter/k/76d3ee/32.png) [@knewt](https://meta.discourse.org/u/knewt)
#### Post date: [December 13, 2019, 10:29pm UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/15 "2019-12-13T22:29:34Z")

</div>

@codinghorror I’m hitting this same basic issue on my forum, wondering if there’s yet any way to force the onebox blacklist to work on sibling domains please?

In my case I have `forum.x.org` and `archive.x.org`. The latter uses the forum as an sso provider to allow entry. When entering a url from the archive, it gets oneboxed, and the url gets redirected as far as a `forum.x.org/session/sso_provider?sso=.....` link, which if clicked on then results in an error page.

---

<div class="post-metadata">

### Author: ![knewt](https://avatars.discourse-cdn.com/v4/letter/k/76d3ee/32.png) [@knewt](https://meta.discourse.org/u/knewt)
#### Post date: [December 14, 2019, 12:50pm UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/17 "2019-12-14T12:50:59Z")

</div>

@codinghorror Ah, I’ve just checked something this morning, and it only seems to be doing it for links that had been oneboxed (with a bad redirected link) _before_ I put the archive domain into the onebox blacklist. So there must be a onebox cache? Any idea how to remove links from that?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 15, 2019, 6:36pm UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/18 "2019-12-15T18:36:06Z")

</div>

You can add a query string like

`example.com/link?x`

If you want to forcefully break caching.

---

<div class="post-metadata">

### Author: ![knewt](https://avatars.discourse-cdn.com/v4/letter/k/76d3ee/32.png) [@knewt](https://meta.discourse.org/u/knewt)
#### Post date: [December 17, 2019, 1:13am UTC](https://meta.discourse.org/t/how-can-i-stop-onebox-redirection/81515/19 "2019-12-17T01:13:56Z")

</div>

Thanks, good to know. Seems that it fell out of the cache on it’s own in time, so sorted out now, but useful in case of any future issues.
