Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
Force a browser to load the 'https' edition of a website, not the 'http'?

I'm open to suggestions, if it is possible to do this.

share|improve this question

marked as duplicate by BloodPhilia, studiohack Mar 23 '11 at 21:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

9  
You do realize that many websites do not support HTTPS? –  grawity Mar 22 '11 at 21:50
add comment

3 Answers

No, because if the web site does not support https. For example https://google.com kicks you to http://google.com https://amazon.com gives you a big red nasty warning. https://apple.com doesn't even load a page.

share|improve this answer
1  
https://www.google.com/ –  grawity Mar 22 '11 at 22:15
    
No, but not for this reason. Chrome specifically doesn't allow this level of rewriting. Firefox manages to do this, with a plugin that has a map from http site to https site. –  Rich Homolka Mar 22 '11 at 23:16
add comment

What you're asking for is already a Firefox plugin called HTTPS-Everywhere. The Chrome API doesn't seem to offer enough control to allow that level of URL rewriting.

Even if you could, there are reasons not everyone uses https, caching and virtual hosts, etc. There's a recent slashdot post that covers some of the reasons why. You wouldn't be able to blindly say 'http => https', so you would need an intelligent plugin like above, which doesn't exist for chrome.

share|improve this answer
    
'Caching' applies only in networks that use a caching proxy server. Client-side caching works fine as always. 'Virtual hosts' can be implemented using TLS SNI. –  grawity Mar 23 '11 at 20:46
    
Thanks @grawity, yes, those topics are discussed in the references i cited. –  Rich Homolka Mar 23 '11 at 20:47
add comment

This isn't really an answer, but here's what you could do if you have FireBug or a JavaScript console available... using JavaScript you'd check for the existence of an HTTPS version of the site, and go to it if it exists... otherwise this will just alert() you that no HTTPS version of that site exists.

Maybe this will just put a perspective on what you're asking? I dunno...

var jQuery = jQuery || null;

if (!jQuery){ // Load in jQuery
    (function(){j=document.createElement("SCRIPT");j.src="http://code.jquery.com/jquery-latest.pack.js";document.getElementsByTagName("HEAD")[0].appendChild(j);})() 
}
var timeout = window.setInterval(function() { // wait for jQuery to load
    if(jQuery) {
        window.clearInterval(timeout);  // once jQuery is loaded kill the interval
        (function($) {  // make sure $=jQuery
            $(document).ready(function() { // on document ready... 
                if(document.location.protocol != 'https:') { // check the protocol to see if we're already on https
                    var url = document.location.href.replace('http:','https:'); // if not, try to load the https version
                    $.ajax({
                        type: 'GET',
                        url: url,
                        success: function(r) {
                            window.location = url; // if successful, load the https version
                        },
                        error : function(r) {
                            alert('https does not exist for this site'); // 
                        }
                    });
                }else {
                    alert('already on https');
                }
            });
        })(jQuery);
    };
},1000);
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.