Loading different JS for http and https
If you link to the JS file just using something like //examplesite.com/js/jsfile.js without the http:// or https:// the browser should automatically get the correct http or https version
If you link to the JS file just using something like //examplesite.com/js/jsfile.js without the http:// or https:// the browser should automatically get the correct http or https version
Thanks to @Sorin for posting the trac. From there I found a solution using just filters in functions.php (so no editing the core) Thanks @mensmaximus for posting there: Link: https://core.trac.wordpress.org/ticket/33887#comment:3 <?php add_filter( ‘network_admin_url’, ‘mmx_network_admin_url’, 1, 2 ); function mmx_network_admin_url( $url, $path ){ $url = “https://my_master_domain/wp-admin/network/” . $path; return $url; } add_filter( ‘admin_url’, ‘mmx_admin_url’, 1, 3 … Read more
If the fonts are loaded from a plugin, a hook will have to be used to insert them, you can disable the hook, but you’ll need to know where it’s coming from. Mostly because you’ll need the handle of the script. There are quite a few different ways it could be done so I’ll try … Read more
I don’t believe WordPress sends HTTPS requests unless it has been told to do so. It sounds like you need to undo some previous configuration — most likely change/remove the FORCE_SSL_LOGIN constant. You may have plugins participating as well though. Make sure to check that. Reference: http://codex.wordpress.org/Administration_Over_SSL
WordPress checks the return value of is_ssl() before creating URLs using get_bloginfo(). If the function returns true, it creates https URLs. If it returns false, it creates http URLs. From the WordPress source … function is_ssl() { if ( isset($_SERVER[‘HTTPS’]) ) { if ( ‘on’ == strtolower($_SERVER[‘HTTPS’]) ) return true; if ( ‘1’ == $_SERVER[‘HTTPS’] … Read more
This is happening because WordPress saves URLs in content absolutely by default (meaning that it’s actually got your urls saved as http://example.com in the database). So to fix this you’ll want to run a search and replace in your database to fix those errors. I like to use the plugin Better Search Replace because it … Read more
If you place your “custom” directives outside of any # BEGIN … / # END … comment markers then WordPress (and plugins) should not overwrite them when they update. (Of course, if you have plugins that don’t “play nice” then they could do anything to .htaccess if you let them, so you would need to … Read more
When I build themes, I also like to make the WordPress header as clean as possible and then reconstruct it to my own liking. The code below is excessive for your question, but it might help you with other ‘WordPress inserted code’ in the future. The key snippet of code you are looking for is … Read more
Based on your question, I assume this is the plugin you are using to enable SSL: WordPress HTTPS. Considering that the plugin hasn’t been updated in two years and their support questions haven’t been resolved, there may be some compatibility issues with the latest version of WordPress (4.6 at the time of this writing). My … Read more
Just a quick note, the code define(‘FORCE_SSL_ADMIN’, true); if ($_SERVER[‘HTTP_X_FORWARDED_PROTO’] == ‘https’) $_SERVER[‘HTTPS’]=’on’; need to be at the top of the config file just after the <php or it will not work.