From 6fdaf8e679ed762b6a70ae2550e36f926afe9b3a Mon Sep 17 00:00:00 2001 From: Maria Stervic Date: Thu, 4 Jan 2018 12:31:12 +0200 Subject: [PATCH] Update httpsRedirect.md --- snippets/httpsRedirect.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/snippets/httpsRedirect.md b/snippets/httpsRedirect.md index 7cf087584..66cc0a568 100644 --- a/snippets/httpsRedirect.md +++ b/snippets/httpsRedirect.md @@ -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 +```