---
title: "Protocol Relative URLs Not Working"
description: "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..."
url: https://www.inmotionhosting.com/support/website/protocol-relative-urls-not-working/
date: 2014-06-24
modified: 2023-07-18
author: "Brad Markle"
categories: ["Website"]
type: post
lang: en
---

# Protocol Relative URLs Not Working

| ## 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](https://www.inmotionhosting.com/support/website/error-numbers/diagnose-javascript-errors/): ** 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. |
