Make my site https

Can I make my site secure?
If yes, how this can be done.

1 Like

If you mean secure in the sense of https then just type that it’s automatically active. If you mean passwords, tokens and such you’ll need to put in the level of effort you think is worthwhile.

2 Likes

I found the solution:

if (location.hostname == ‘<project_name>.glitch.me’ && location.protocol != ‘https:’) {
location.href = ‘https:’ + window.location.href.substring(window.location.protocol.length);
}

1 Like

Hi Dmitry. We didn’t understand that was what you wanted to do but I will point that is not the solution you want to use. This is something you’ve decided to add to client-side right, i.e. it happens in the browser?

That isn’t safe and secure. What you want to look up is server-side redirection and since (I think) you are using Express perhaps this example will help.

1 Like