Update httpsRedirect.md

This commit is contained in:
Maria Stervic
2018-01-04 12:31:12 +02:00
committed by GitHub
parent 54a6caee59
commit a65e4bd56b

View File

@ -9,3 +9,7 @@ const httpsRedirect = () => {
if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]);
};
```
```js
httpsRedirect(); // If you are on http://mydomain.com, you are redirected to https://mydomain.com
```