For a spesific page (order.php) I want if the user didn't entered https to automatically reload it with https (note that this page loads also other pages with includes based on a _GET variable-e.g order.php?stat= 1) and in all other pages to enforce http (all other pages loads with index.php in which I include all the others based on a _GET variable like above any suggestions?)
Enforcing https with javascript
Collapse
X
-
Tags: None
-
After some digging I found this which works, (though I do not know if it will with nice URLS)
Note that the script above enforce http if the user types httpsCode:function goElseWhere() { var url = document.URL; if (url.indexOf("https")==-1) { //alert('den einai https'); } else { //alert('einai https'); url=url.replace(/https/i,"http") window.location = url; } } goElseWhere();
Comment