Protocol Relative URLs Not Working Updated on July 18, 2023 by Brad Markle 0 Minutes, 45 Seconds to Read Problem: I am using Protocol Relative URLs / relative URLs when referencing css and javascript. When I access my page over https / ssl, the css and js is being called over http / no ssl. It is resulting in the following javascript error: [blocked] The page at ‘https://www.domain.com/page.php’ was loaded over HTTPS, but ran insecure content from ‘https://www.domain.com/style.css‘: this content should also be loaded over HTTPS. Solution: If you are using the base tag within your header, the protocol being used in your base tag will be used when calling scripts using Protocol Relative URLs / relative URLs. <head> <base href='http://www.domain.com/page.php' /> </head> If you need to use the base tag in your head, make sure to adjust it so that it uses https when using ssl, and http when not using ssl. Share this Article Related Articles How to Create a Local Dev Server with Vagrant AWStats: View Statistics About Your Website Traffic MySQL Error 1064: You Have an Error in Your SQL Syntax MySQL Error 1044 Access Denied Troubleshooting: Fixing the “localhost Refused to Connect” Error HTTP Error Codes: What They Mean and How to Fix Them How to Fix the 504 Gateway Timeout Error 500 Internal Server Error How To Create a PHP Redirect (301, 302, and Dynamic Redirect Examples) Connect to SFTP for Shared Hosting Accounts Using FileZilla