Jump to content

redirect http to https


RobYost

Recommended Posts

or add in web.config:

<rewrite>
 <rules>
  <rule name="Redirect HTTPS" enabled="true" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
    <add input="{HTTPS}" pattern="^OFF$" />
    </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
 </rule>
</rules>
</rewrite>
Link to comment
Share on other sites

  • 2 months later...

If you have login form, put this to Loginform->Script

If you don't have login form, put this to MainForm->Script.

 

@pedrisco's solution working as expected.

if (window.location.protocol === 'http:') {
    window.location.href = 'https:' + window.location.href.slice(5);
};

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...