Update httpsRedirect.md
This commit is contained in:
@ -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
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user