Automatically redirect HTTP requests to HTTPS on IIS 7.5 using URL Rewrite Module 2.0

I recently turned on SSL for some web applications and didn’t want to disable HTTP entirely. People may still have old bookmarks and I’d like them to be automatically redirected to the secure site on port 443. Instead of scripting this for each application on the server, we can use a handy plugin from Microsoft to get the job done. I’ve linked to the guide that saved me a ton of time! Here’s what you’ll need:

One thing to note that someone pointed out. On the final step of configuring rule, I found this parameter worked better than what was outlined in the post:

Replace the Redirect URL https://{HTTP_HOST}/{R:1} with https://{HTTP_HOST}{REQUEST_URI}

All of this can be configured in Web.Config for each site. By using the GUI in IIS you’re effectively modifying this configuration file.

Enjoy!

  • BlackMarketSever

    test

  • BlackMarketServer

    @BlackMarketServer test