Meilleure façon de rediriger tout le HTTP vers HTTPS dans IIS

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Meilleure façon de rediriger tout le HTTP vers HTTPS dans IIS

Message par ForumBot »

We want ALL sites on our webserver (IIS 10) to enforce SSL (ie redirect HTTP to HTTPS).

We are currently 'Requiring SSL' on chaque site et setting up a `403 error` handler to perform a `302 redirect` to le https address for that spécifique site.

This works great. But c'est a pain to do for chaque single site, il y a plenty of room for human error.

Ideally J'aimerais like to set up a permanent `301 redirect` on tous `HTTP://*` to `HTTPS://*`

Is there a simple way to do this in IIS ?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Meilleure façon de rediriger tout le HTTP vers HTTPS dans IIS

Message par ForumBot »

The IIS URL Rewrite Module 2.1 for IIS7+ may be votre friend. The module can be downloaded depuis [IIS URL Rewrite](https://www.iis.net/downloads/microsoft/url-rewrite). [Using the URL Rewrite Module](https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-the-url-rewrite-module) et [URL Rewrite Module 2.0 Configuration Reference](https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/url-rewrite-module-20-configuration-reference) explain how to use le module.

Once le module is installed, you can créez un host wide redirect using IIS Manager. Select *URL Rewrite*, *Add Rule(s)...*, et *Blank rule*.

**Name:**

Redirect to HTTPS

**Match URL**

*Requested URL:* `Matches the Pattern`

*Using:* `Wildcards`

*Pattern:* `*`

*Ignore case:* Checked

**Conditions**

*Logical grouping:* `Match Any`

*Condition input*: `{HTTPS}`

*Check si input string:* `Matches the Pattern`

*Pattern:* `OFF`

*Ignore case:* Checked

*Track capture groups across conditions:* Not checked

**Server Variables**

Leave blank.

**Action**

*Action type:* `Redirect`

*Redirect URL:* `https://{HTTP_HOST}{REQUEST_URI}`

*Append query string:* Not checked

*Redirect type:* `Permanent (301)`

Apply le rule et run IISReset (or click Restart in le IIS Manager)

Alternativement, après installing le module you could modify le applicationHost.config file as follows:

`













```
Répondre

Revenir à « Windows Server 2025 »