One of our developers wanted to automatically redirect http requests to https, so if a user browsed http://www.itfountain.com then they should be automatically redirected to https://www.itfountain.com. A simple enough task to accomplish with a line of configuration in Apache:
Redirect permanent / https://www.itfountain.com/
Unfortunately the web server is IIS and not Apache. Fortunately there is an IIS extension called URL Rewrite that can accomplish this.
Head over to http://www.iis.net/downloads/microsoft/url-rewrite, download and install the extension. It’s a very quick install and doesn’t require a reboot, at least not on Windows 2008 R2.
Once installed select the website you want to add the redirect to and there should be a new feature called URL Rewrite.
Open the feature and click on ‘Add Rule(s)…‘
Start with a ‘Blank Rule‘
There are several sections that must be filled in to create the rule. In the ‘Match URL‘ section fill in the details as follows.
Add a new conditon In the ‘Conditions‘ section by clicking on ‘Add…‘
Fill in the rule in as follows.
Finally, fill in the ‘Action‘ as follows.
And the rule should be complete and working.