Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What URLs on an https page need to be https?

I did a search and could not find an answer on here to my question. What I am confused about is what URLs on an https page need to be https, as opposed to http.

I am making a series of pages my website that must be accessed over https. At the top of the pages is a menu. I accidentally included a style sheet into the page using http, instead of https, and all the browsers I tried gave me a warning about insecure content. But, I can leave the menu links at the top of the page http, and there's no problem.

So, am I correct in saying that things that are being loaded onto the page, such as style sheets and images, need to have https in the link, but that plain old href links can just have http in them?

Thanks for your advice.

like image 840
Nate Avatar asked Jul 14 '12 17:07

Nate


People also ask

Should all links be HTTPS?

It's not necessary but it is more secure to use both. If you want to ensure your internet access is secure and private, use HTTPS and a VPN. HTTPS gives you end-to-end encryption, and a VPN encrypts data from your computer to the VPN server.

Do all URLs start with HTTPS?

Fortunately, there are two quick checks to help you be certain: Look at the uniform resource locator (URL) of the website. A secure URL should begin with “https” rather than “http.” The “s” in “https” stands for secure, which indicates that the site is using a Secure Sockets Layer (SSL) Certificate.

Which websites would require the https protocol to be used?

Simply put, any website that requires login credentials or involves financial transactions should use HTTPS to ensure the security of users, transactions and data.

What is required to enable HTTPS?

To use HTTPS with your domain name, you need a SSL or TLS certificate installed on your website. Your web host (Web Hosting Provider) may offer HTTPS security or you can request a SSL/TLS certificate from Certificate Authorities and install it yourself. SSL/TLS certificates may need to be renewed periodically.


2 Answers

Generally your secure pages such as purchase page, credit card etc processing pages are set to https or sometimes all pages such as websites for banks or other financial institutes or even login pages.

You can leave it to browser to deciper http or https part by using what is called protocol-relative URLS in which you simply do not specify either of http or https and still browser will be able to figure it out. An example:

//example.com
//google.com

Let's say your domain is foo.com, you would specify all URLs like:

//foo.com/page1.html
//foo.com/otherpage

So you simply leave the http or https part in your URLs.

To know more about protocol-relative URLS, see:

  • http://paulirish.com/2010/the-protocol-relative-url/
like image 58
Blaster Avatar answered Sep 29 '22 10:09

Blaster


Yes, all links that are used to create the page itself (the HTML, the CSS, JavaScript, the images) need to be served over https. That means all URLs of that domain need to be served over https.

Links to other websites can be http just fine. You may want to check if those links can be visited over https as well because then the user will use a secure connection to visit those website as well.

like image 21
Simeon Visser Avatar answered Sep 29 '22 11:09

Simeon Visser