From ddff7a1be98f4f5e3045f7a0b03791ef071b37ed Mon Sep 17 00:00:00 2001 From: suciuandrei94 <32135458+suciuandrei94@users.noreply.github.com> Date: Fri, 5 Mar 2021 10:09:26 +0200 Subject: [PATCH] Fixed www routing (e.g. if someone tried from safari) it wouldn't redirect to https If someone types www.testwebsite.tv it won't route to https://testwebsite.tv , thus having this fix on client side is fixing this problem. --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index dfa05d6..9fe7643 100644 --- a/src/index.js +++ b/src/index.js @@ -17,7 +17,9 @@ const HttpsRedirect = ({ disabled, children }) => { window.location.href = window.location.href.replace( /^http(?!s)/, 'https' - ); + ).replace( + 'www.', + ''; return null; }