Images a broken on login page

AI-generated summary

User Taxick reported that images on the login page of their Discourse forum at wpdebat.dk were not displaying, though the image URLs worked when opened directly. Arkshine suggested enabling Force HTTPS to resolve mixed content issues, but this broke site functionality for Taxick, forcing them to revert the setting. Further troubleshooting revealed the issue stemmed from inconsistent hostname configuration — using www.wpdebat.dk in DISCOURSE_HOSTNAME while the site also served wpdebat.dk. Taxick resolved the problem by removing www. from the settings, restoring image display. Arkshine advised choosing either www or non-www consistently, updating app.yml, and setting up a redirect in Virtualmin for SEO and analytics consistency. The root cause was misconfigured domain redirects and mixed content due to hostname mismatch.

Hi

I working on a new forum. But i have a problem with the login page.. Its not showing the image. → https://wpdebat.dk/

But if I right-click on the image and copy the image URL and open the URL the image shows fine

https://www.wpdebat.dk/uploads/default/original/1X/b48583f04a50eea67fe53105d6ff8ae0db8260bd.png

What can be wrong?`

Regards

Thomas

EDIT: i have try 3 browser, and i have try to clear my browser cache!

Hi, you can Force HTTPS in the options:

This will help not to have mixed content http/https.

image

Hi @Arkshine

Thanks for the reply.

After I force HTTPS, my site is broken.

I can’t log in / log out, create posts, save settings, and more..

Then I run

cd /var/discourse
./launcher enter app
rails c
SiteSetting.force_https = false
exit

Then i disable: force HTTPS - Now the site is online Again but the images a broken.

Here are some more details

  • In the app.yml my hostname is: DISCOURSE_HOSTNAME: ‘www.wpdebat.dk’

  • I use Virtualmin as control panel on my server

  • As Webserver is use apache2

  • Ubuntu 24.04

  • I have used this guide @ virtualmin forum

Regards

Thomas

Sorry - Is was update the post above when you reply

Thanks for giving more context.

From what I see, wpdebat.dk works on my side. You have a valid SSL certificate for root and www. You still have mixed content; as the guide says, you need force https to fix that.

Is it wanted to use www.wpdebat.dk instead of wpdebat.dk in DISCOURSE_HOSTNAME?
I don’t know if it can cause an issue, but I would use wpdebat.dk and tell Virtualmin to redirect www → non-www (or the inverse if you prefer to keep www).

@Arkshine

Problem Solved - There was a problem with Website Redirects

I removed the www. from the settings, and now i works.

Thanks for the help

I see. I’m glad it works now!

Since you’re using www in Discourse config, that would cause trouble.

I would still encourage you to choose between www or non-www, adjust app.yml, and make a redirection in Virtuamin. That should give you SEO benefits (consistency in the URL, preventing content duplication, analytics under a single domain, etc).