Protocol Relative URLs Not Working Brad MarkleUpdated on July 18, 2023 1 Minute 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. Summarize and Research with AIShare on Social Media Related Articles How to Upload Large Files Without FTP Timeouts eCommerce – Setup your Merchant Account Gateway How to Zip and Unzip Files on Windows 11 and Windows 10 How to Transfer and Backup Website Files with Rsync .htaccess File Reference List: Rules, Fixes, and Uses How to Force a File Download With .htaccess Redirecting Visitors to an Under Construction Page How to Force www and non-www on Your Domain with .htaccess How to Use the .htaccess File Domain Resolves to Server Default Page