# SCSS variables referencing uploads broken in subfolder installs

**URL:** <https://meta.discourse.org/t/scss-variables-referencing-uploads-broken-in-subfolder-installs/101038>\
**Category:** Bug\
**Created:** [11월 1, 2018, 7:43오전 UTC](https://meta.discourse.org/t/scss-variables-referencing-uploads-broken-in-subfolder-installs/101038 "2018-11-01T07:43:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yjwong](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yjwong/32/123852_2.png) [@yjwong](https://meta.discourse.org/u/yjwong)\
**Post date:** [11월 1, 2018, 7:43오전 UTC](https://meta.discourse.org/t/scss-variables-referencing-uploads-broken-in-subfolder-installs/101038/1 "2018-11-01T07:43:04Z")

</div>

Hi there,

After installing Discourse into a subfolder using `DISCOURSE_RELATIVE_URL_ROOT`, and then using a custom variable that references an uploaded file in Admin → Customize → Themes → Edit CSS/HTML, the URL generated in the CSS is wrong.

For example, if `DISCOURSE_RELATIVE_URL_ROOT` is `/my/forum`, the CSS generates a URL that looks like `/my/forum/my/forum/uploads/default/original/1X/...` (note the repeated relative URL root).

If S3 is used, the URL generated looks like `/my/forum//something.dualstack.s3.amazonaws.com/uploads/default/original/1X/...`.

As a workaround, using an absolute URL (with the appropriate CORS configuration on S3) works.

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [11월 12, 2018, 11:29오전 UTC](https://meta.discourse.org/t/scss-variables-referencing-uploads-broken-in-subfolder-installs/101038/2 "2018-11-12T11:29:48Z")

</div>

@tgxworld is that something that will be solved by your PR?

[https://github.com/discourse/discourse/pull/6573](https://github.com/discourse/discourse/pull/6573)

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [11월 13, 2018, 5:35오전 UTC](https://meta.discourse.org/t/scss-variables-referencing-uploads-broken-in-subfolder-installs/101038/3 "2018-11-13T05:35:56Z")

</div>

It wouldn’t solve the problem here since the PR deals only with site settings. @sam might have a better idea here since he worked on the upload assets support in themes.

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [11월 14, 2018, 1:57오후 UTC](https://meta.discourse.org/t/scss-variables-referencing-uploads-broken-in-subfolder-installs/101038/4 "2018-11-14T13:57:34Z")

</div>

@nbianca can you add that to your list? Makes sure you test both local and S3 uploads when using subfolder.

---

<div class="post-metadata">

**Author:** ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)\
**Post date:** [11월 16, 2018, 1:11오후 UTC](https://meta.discourse.org/t/scss-variables-referencing-uploads-broken-in-subfolder-installs/101038/5 "2018-11-16T13:11:31Z")

</div>

Fixed by

[https://github.com/discourse/discourse/pull/6622](https://github.com/discourse/discourse/pull/6622)

---

<div class="post-metadata">

**Author:** ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)\
**Post date:** [11월 24, 2018, 5:00오후 UTC](https://meta.discourse.org/t/scss-variables-referencing-uploads-broken-in-subfolder-installs/101038/6 "2018-11-24T17:00:09Z")

</div>

This topic was automatically closed after 2 days. New replies are no longer allowed.
