custom logo file not called with https Topic is solved

Need help with the Administration of your Joomla! 3.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
Hans-Dieter
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Fri Mar 05, 2021 9:13 pm

custom logo file not called with https

Post by Hans-Dieter » Mon May 17, 2021 3:52 am

adding my custom logo to the template (Protostar) will add the logo file as

Code: Select all

<img src="http://www.mydomain.com/images/logo_hp.png">
when using "Templates > Protostar > Advanced > Logo.
All other images are added like

Code: Select all

src="/images/family.jpg
To run the site properly in https, this needs to be

Code: Select all

<img src="https://www.mydomain.com/images/logo_hp.png">
or as the image sample above.

How can I go about this without directly editing the template's index.php file ?
Thank you

User avatar
imanickam
Joomla! Master
Joomla! Master
Posts: 27662
Joined: Wed Aug 13, 2008 2:57 am
Location: Chennai, India

Re: custom logo file not called with https

Post by imanickam » Mon May 17, 2021 7:29 am

One of the ways could be to use an extension such as ReReplacer (https://extensions.joomla.org/extension/rereplacer/). Of course, there could be a performance issue as the HTML output would be searched and replaced with the revised string everytime a page loads.

The URL for the logo file is got from the following statement in the file index.php that is located in the directory \templates\protostar.

Code: Select all

	$logo = '<img src="' . htmlspecialchars(JUri::root() . $this->params->get('logoFile'), ENT_QUOTES) . '" alt="' . $sitename . '" />';
Another way could be to create a copy of the template Protostar and edit the file index.php of the copied new template. Of course, you have to make sure that the file index.php of the template Protostar template is changed, the change has to be implemented in the copied new template.

Note:
First check whether the https works fine in the site.
Ilagnayeru (MIG) Manickam | இளஞாயிறு மாணிக்கம்
Joomla! - Global Moderators Team | Tamil (தமிழ்) Translation Team

Eegan - Support the poor and underprivileged

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 27833
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: custom logo file not called with https

Post by Per Yngve Berg » Mon May 17, 2021 8:18 am

I don't know what is wrong here. JUri::root should be https when the site is loaded over https.

Do you run the site behind a reverse proxy with http between the proxy and web server?

Hans-Dieter
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Fri Mar 05, 2021 9:13 pm

Re: custom logo file not called with https

Post by Hans-Dieter » Mon May 17, 2021 7:41 pm

Per Yngve Berg wrote:
Mon May 17, 2021 8:18 am
I don't know what is wrong here. JUri::root should be https when the site is loaded over https.

Do you run the site behind a reverse proxy with http between the proxy and web server?
The site does not run behind a reverse proxy.
The site was created without https, so the image was set using http.
Could that be the reason that the link is "somewhere" hardcoded ?
To run the site with https, is it needed to have this set in Global Config > Server as this does not work. I have set to use https in a .htaccess file. Server is not using Apache, just to mention that.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 40008
Joined: Sat Apr 05, 2008 9:58 pm

Re: custom logo file not called with https

Post by Webdongle » Mon May 17, 2021 9:48 pm

The problem is using .htaccess to force https. If setting it in global config does not work you must set use 'Use URL Rewriting'
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Hans-Dieter
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Fri Mar 05, 2021 9:13 pm

Re: custom logo file not called with https

Post by Hans-Dieter » Mon May 17, 2021 11:59 pm

my server can't use URL Rewriting, no such "feature".
Setting in Global, how is this check be done, as my server has a SAN Cert for the domain and it is working just fine.
Question is, why does Joomla give me a "Time out" error ? I try to set this behind my NAT router.

Hans-Dieter
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Fri Mar 05, 2021 9:13 pm

Re: custom logo file not called with https, fixed

Post by Hans-Dieter » Wed May 19, 2021 2:47 am

the problem is solved. :D

The solution is in viewtopic.php?f=706&t=986414#p3630973

Thank you for all your input.


Post Reply

Return to “Administration Joomla! 3.x”