Problems Requiring HTTPS and Preview

4 posts by 3 authors in: Forums > CMS Builder
Last Post: October 10, 2017   (RSS)

By Mikey - October 9, 2017 - edited: October 9, 2017

A question.

How are you linking your site pages to your CSS style sheets?

For example are linking to your CSS like:

<link href="http://yourdomain.com/css/styles.css" rel="stylesheet" />

OR

<link href="https://yourdomain.com/css/styles.css" rel="stylesheet" />

OR

<link href="/css/styles.css" rel="stylesheet" />

OR

<link href="css/styles.css" rel="stylesheet" />

The sites I've been building use either HTTPS or HTTP. In either case I link to the CSS style sheets to my site pages using the method shown below, and "Preview" works for me regardless of https or http:

<link href="css/styles.css" rel="stylesheet" />

Hope this helps,

Zicky

By Dave - October 10, 2017

And to add to what Zicky shared, you can actually remove the http: or https: part (called the "scheme") and use an url like this: 

<link href="//yourdomain.com/css/styles.css" rel="stylesheet" />

And it will use whatever scheme (http: or https:) you're already on.

Let me know if that solves it or if you continue to have issues. 

Dave Edis - Senior Developer
interactivetools.com

By kevbarker1 - October 10, 2017

Thanks Dave and Zicky. I tried removing the scheme and that solved the problem. I was going to use https only on the parts of the site that needed security (forms) but ended up using it throughout anyway. 

Thanks for responding. It helped me solve things. 

Kevin