The user Ironclad14 is moving their Discourse forum from a subfolder (foo.bar/forum) to a subdomain (forum.foo.bar) and encountering issues with CSS loading and missing images. After changing the domain in app.yml and removing the subfolder remap, they face a broken site due to incorrect stylesheet paths (e.g., https://stylesheets/file.css) and 404 errors on uploaded images. Johani suggests safe-mode, but Ironclad14 reports an invalid redirect. Neil identifies the issue: the DISCOURSE_RELATIVE_URL_ROOT: / setting in app.yml is still active, which causes the subfolder behavior. Removing this line resolves the CSS issue Ironclad14. However, images remain inaccessible despite rebaking posts and verifying file existence. Ironclad14 tries restoring a backup and changing permissions, but the problem persists. Fabraz asks if Ironclad14 found a solution.
To make my setup less complicated per @codinghorror’s advice, and since Let’s Encrypt now support subdomains, I decided to move my discourse from foo.bar/forum to forum.foo.bar
What I did:
Changed the domain name in my app.yml, removed the folder remap from custom commands, then remapped foo.bar/forum to forum.foo.bar via discourse remap, then I rebaked posts.
Okay great that worked! Now the only thing left is to fix all my missing images. I’m getting a 404 on all uploaded avatars and uploaded images. Very odd.
Update:
All images return 404. I rebaked posts, recovered uploads from tombstone, and double-checked whether or not the images exist in the directories.
yet it exists both in /var/www/discourse/public/uploads/default/original/1X and in /shared/uploads/default/original/1X (which is symlinked successfully, therefor)