In un server Windows con IIS7, per forzare l'utente che arrivi in http verso la corrispondente pagina https, è necessario procedere come segue:
  • installare il Microsoft URL Rewrite Module
  • installare normalmente il certificato SSL per il sito
  • verificare che in SSL Settings NON sia spuntata la casella "Require SSL"
  • editare il file web.config inserendo le seguenti righe di codice dentro i tag <rules></rules>

 

<rule name="HTTP to HTTPS redirect" stopProcessing="true">
  <match url="(.*)" />
    <conditions>
      <add input="{HTTPS}" pattern="off" ignoreCase="true" />
    </conditions>
  <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>


NOTA: non si tratta dell'unico metodo possibile, ma sicuramente di quello più semplice.
Accenniamo che altri metodi possibili sono:

  • impostare un redirect usando ASP.net
  • creare una custom error page che effettui il redirect

Tutti i metodi indicati comunque possono avere delle controindicazioni, e nessuno rappresenta la soluzione ideale.
 

Found this article interesting?
Subscribe to DomainRegister´s newsletter!

You can unsubscribe at any time by simply clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp s privacy practices here.

  • Windows, IIS 7, SSL
  • 0 Utenti hanno trovato utile questa risposta
Hai trovato utile questa risposta?

Articoli Correlati

 What is the difference between SHA-1 and SHA-2 ?

SHA stands for Signature Hashing Algorithm;  It's a mathematical hash that proves the...

 What is an intermediate certificate and how to get it?

An intermediate certificate is a file needed by the web browser to identify the C.A. who issued...

 How can I install my SSL certificate on more than one server?

Many SSL certificate licences allow to install the same certificate on an unlimited number of...

 How To Fix The Warning : "Site Contains Secure & Non-Secure Items"

A SSL certificate provides cover for all your website files and folders, which are included in...

 I have accidentally deleted my "private key": what can I do now?

First check your backups and see if you can re-install the "private key". If you don't know how...