The user hellekin encountered issues with www.example.com links after migrating a Discourse instance, suspecting a misconfiguration in DISCOURSE_HOST. The community helped identify that DISCOURSE_HOSTNAME should be used instead, which was the root cause hellekin. Neounix provided SQL and Redis commands to search for the problematic domain, while pfaffman suggested checking embeds on try.discourse.org. After correcting the environment variable and rebuilding the container, the issue was resolved hellekin. riking confirmed the fix by verifying image embeds were working riking.
I moved a Discourse instance from one host to another one, from multisite setup to a single host setup with a single container using backup export/import, and some links use www.example.com instead of the correct host.
How do I fix this?
I have set up DISCOURSE_HOST to the hostname, but it does not seem to fix the problem. Is there any SQL query I can do use to find occurrences of www.example.com?
To quickly view all your global settings, you can run this from the Rails console, and all the global settings will be visable (I’m sure there is a better way to do this…, but this is quick and works OK)
Following @pfaffman’s link I realized that I used DISCOURSE_HOST instead of DISCOURSE_HOSTNAME.
@neounix’s useful investigation tips did not yield any result, so I expect the first issue to lead to the current situation. I’m rebuilding the container to see…
Container rebuilt and links show formerly broken pictures, so I guess it’s solved. Thank you both!
Yes, that make perfect sense now that I took a look at the code. Discourse config sets the default hostname to "www.example.com" in the config file, so if there was a mistake in the build file (like you describe @hellekin) , looks like you will get the default
Maybe someday someone might change that config default to read: