jdw
jdw

Reputation: 1573

What is the most 'kosher' or 'correct' way to do https redirection?

The 'Most Visited' or the 'Speed dial' page of Google Chrome shows my website as a 500 or 404 server error consistently, even if I remove it and it gets reset. I fear it has something to do with my https redirection scheme.

The reason I suspect it is because of https is because I don't have this problem with running my app locally, the preview of the page shows up correctly, title and all. The only difference is that I am not running https on my local machine.

My main question is what is the most 'kosher' way to redirect to https? I currently just use a client side JS scheme. I.e window.location.href = www.example.com. Could this be the reason my site doesn't show correctly on Chrome's 'Most Visited' page?

I haven't seen this problem on Firefox.

Redirect may have nothing to do with it at all, but it is the only difference I know of between my main server and my local one.

Upvotes: 1

Views: 82

Answers (1)

Jonah
Jonah

Reputation: 16222

Typically if you want to redirect "http://www.example.com" to "https://www.example.com" you do it on the server side, with a scripting language like php or ruby or python, or configure your web server (eg, Apache) to do it.

Upvotes: 1

Related Questions