# Instalação em subpasta: links externos são alterados/redirecionados para links relativos ao site

**URL:** <https://meta.discourse.org/t/subfolder-install-external-links-get-changed-redirected-to-site-relative-links/102506>\
**Category:** Support\
**Tags:** subfolder\
**Created:** [Novembro 22, 2018, 12:59am UTC](https://meta.discourse.org/t/subfolder-install-external-links-get-changed-redirected-to-site-relative-links/102506 "2018-11-22T00:59:40Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![vincentp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vincentp/32/110063_2.png) [@vincentp](https://meta.discourse.org/u/vincentp)\
**Post date:** [Novembro 22, 2018, 12:59am UTC](https://meta.discourse.org/t/subfolder-install-external-links-get-changed-redirected-to-site-relative-links/102506/1 "2018-11-22T00:59:41Z")

</div>

Hi

I just migrated our discourse install from a subdomain to a subfolder. Yes, I know it’s not recommended, however we saw a significant (50%) drop in organic search traffic after moving our forums (and we’re sure there is no other cause).

So after a lot of messing about I have it working well, however all external links in posts are broken.

The links all render correctly, and the html markup is correct, but for some reason link tracking is changing to be link relative to our site.

The discourse install is setup behind an IIS reverse proxy with the following rewrite rule

```
<rewrite>
  <rules>
    <rule name="discourse Reverse Proxy" stopProcessing="true">
      <match url="(.*)" />
      <action type="Rewrite" url="http://discourse/{R:1}" />
      <serverVariables>
            <set name="HTTP_X_FORWARDED_HOST" value="www.finalbuilder.com" />
            <set name="HTTP_X_FORWARDED_PROTO" value="https" />
            <set name="HTTP_X_REAL_IP" value="{REMOTE_ADDR}" />
      </serverVariables>
    </rule>
  </rules>
</rewrite>

```

I have done all the remapping etc suggested in [https://meta.discourse.org/t/subfolder-support-with-docker/30507](https://meta.discourse.org/t/subfolder-support-with-docker/30507) and I’m not seeing any 404s or other errors.

Is there something else I need to do for external links to work correctly?

---

_[View the full topic](https://meta.discourse.org/t/subfolder-install-external-links-get-changed-redirected-to-site-relative-links/102506)._
