0

I ran into trouble when I enabled SSL on my magento web store, my javascript console throws a mixed content exception since some contents of the pages are still requesting http:// protocol. I would like all my http:// urls to be switched over to // so my site can successfully load content from both protocols. Where in the magento file structure can I find the script that writes the protocal for javascript tags in the header of my homepage ?

Sorry for the noobish question as I am completely new to magento, any help would be appreciated

  • if your url is hardcoded, you have to change it in templates. – MagenX Sep 9 '16 at 20:18
0

This is coming from configuration: System > Configuration > Web > Unsecure > Base JavaScript URL and Base Skin URL

Unfortunately you cannot change it to //example.com/ because the form validation insists on a URL with protocol.

You can change the value directly in the database:

UPDATE core_config_data SET value='//example.com' WHERE path='web/unsecure/base_js_url'

This works but then you can never save the "web" configuration form from the backend anymore.

It's probably better to just change the "unsecure" base URLs to "https" so that they always load with HTTPS.

| improve this answer | |
  • thank you, I will try looking for base URLS and changing them one by one, also how much of a risk would it be if I set unsecure urls to https:// in System -> Configuration -> General -> Web ? – MaxPowers Sep 9 '16 at 21:01
  • The only risk I am aware of is that if you use a Varnish cache in front of Magento you need additional SSL termination to be able to cache HTTPS URLs. This answer might also interest you: magento.stackexchange.com/questions/107083/… – Fabian Schmengler Sep 9 '16 at 21:06
  • oh I see, in case I want to manually change each header link to https would I find these hard-coded urls in my template file structure ? – MaxPowers Sep 10 '16 at 16:26
  • There should not be any hard coded links, but if there are, you have to change them separately, yes – Fabian Schmengler Sep 10 '16 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.