# Self Link previews not showing for private sites?

**URL:** <https://meta.discourse.org/t/self-link-previews-not-showing-for-private-sites/35591>\
**Category:** Bug\
**Created:** [16 نوفمبر 2015، 12:23ص UTC](https://meta.discourse.org/t/self-link-previews-not-showing-for-private-sites/35591 "2015-11-16T00:23:25Z")\
**Posts on this page:** 1\
**Showing post:** 11

<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:** [1 فبراير 2016، 2:20م UTC](https://meta.discourse.org/t/self-link-previews-not-showing-for-private-sites/35591/11 "2016-02-01T14:20:52Z")

</div>

Hey @techAPJ, good and bad news!

First, the good news: It’s working on my instance.

Second: Looks like the rails method `recognize_path` doesn’t play along with rails `config.relative_url_root`. So my bug wasn’t related with being private at all. Maybe this is @Joey_Tuan case?

So, it’s a subfolder 🐛 after all 😄 (I stump on subfolder bugs even when I’m looking somewhere else).

If we want to fix it at Discourse level we need:

```diff
diff --git a/lib/onebox/engine/discourse_local_onebox.rb b/lib/onebox/engine/discourse_local_onebox.rb
index 5fd4897..5e3b797 100644
--- a/lib/onebox/engine/discourse_local_onebox.rb
+++ b/lib/onebox/engine/discourse_local_onebox.rb
@@ -14,7 +14,7 @@ module Onebox
         if other.kind_of?(URI)
           uri = other
           begin
- route = Rails.application.routes.recognize_path(uri.path)
+ route = Rails.application.routes.recognize_path(uri.path.sub(Discourse.base_uri, ""))
             case route[:controller]
             when 'uploads'
               super
@@ -34,7 +34,7 @@ module Onebox
 
       def to_html
         uri = URI::parse(@url)
- route = Rails.application.routes.recognize_path(uri.path)
+ route = Rails.application.routes.recognize_path(uri.path.sub(Discourse.base_uri, ""))
         url = @url.sub(/[&?]source_topic_id=(\d+)/, "")
         source_topic_id = $1.to_i

```

And we have local oneboxing at subfolder install working.

---

_[View the full topic](https://meta.discourse.org/t/self-link-previews-not-showing-for-private-sites/35591)._
