Domain missing from some requests after migration from subfolder back to subdomain

Hello guys,

I have a Discourse installation which was living in a subdirectory and has now been moved to a subdomain. Everything seems to be working now, but we have a pending problem where Discourse calls the “theme-javascripts” domain instead of a subdirectory.

Latest Discourse version.

How can we solve this?

Thanks.

1 Like

Did you follow Serve Discourse from a subfolder (path prefix) instead of a subdomain backward?

Can you share your URL?

2 Likes

Jay, I did - not my first rodeo doing this, either, in the past without issues. The new URL is (hiding URL).

Do note: a designer is currently working on the style, so you might see weird things happening in the navigation, right now.

1 Like

I see, something is referencing

https://theme-javascripts/44e23af3ca6cf81f41e66da02a80e1c9b45653cc.js?__ws=community.windowcleaner.com

instead of

https://community.windowcleaner.com/theme-javascripts/44e23af3ca6cf81f41e66da02a80e1c9b45653cc.js?__ws=community.windowcleaner.com

Maybe there is something left in your app.yml that’s referring to. . . hmm. . . something (like maybe a “/”) that’s making it add the https to the front?

1 Like

Indeed, that is what is happening - trying several rebuilds, no luck yet. If I manage to find out I will update the thread!

1 Like

Still no luck with this one! I narrowed it down to code that comes from the official plugins - I will update this if I find a solution.

1 Like

Is your hostname blank somewhere?

What’s the value of DISCOURSE_HOSTNAME: in app.yml?

2 Likes

Hey @merefield, not blank - the value is (hiding URL). But I suspect the same, or something along those lines, as the theme-javascript is being called with two slashes in front of it. I wonder if it could be some value in the database which was not updated after the move from the subdirectory. Trying to look into that.

2 Likes

I think I fixed it - all I had to do was a remap; not sure how that wrong URL was there in the first place, as the error appeared after a rebuild that was not done by me.

Anyhow, this is what I did to fix this:

> ./launcher enter app
> discourse remap //theme-javascripts  /theme-javascripts
> Rewriting all occurrences of //theme-javascripts to /theme-javascripts
> THIS TASK WILL REWRITE DATA, ARE YOU SURE (type YES)
> YES
> theme_fields=4
> Done

Hope this helps somebody else in the future.

5 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.