-1

I am doing a project for my PHP class. It is required to check if the user is using https protocol if not, the user should be redirected to https. I found a this topic talking about it in here, and I implemented the code exactly at the beginning of my page. However, when I run the page, it tells me that my connection is not correct. I do not know if I implemented something wrong.

example of what i am getting

aftermath
  • 29
  • 5

1 Answers1

0

Click advanced -> continue anyway.

You will connect & hopefully your web server redirects you to the HTTPS version.

A lot of modern browsers are starting to do this to sites that don't have SSL chrome & firefox both warn iirc.

Or it's a self signed certificate in which case all modern browsers will warn you.

  • but should not the code redirect the user to https? In the advanced option, continue anyway is not available. Moreover, I am writing and running the code on a localhost. – aftermath Nov 14 '18 at 14:55
  • you're probably using a self signed certificate then, in that case the browser will block it as well. Every browser is different, continue anyway may be under "learn more". – thecoolestguyever123 Nov 14 '18 at 15:04