Automatically Redirect HTTP requests to HTTPS on IIS 7 using URL Rewrite 2.0
You will need the following items in order for this to work correctly.
- SSL Certificate for site installed in IIS.
- Site properly installed and configured for SSL (site set up and binding in IIS configured).
- URL Rewrite 2.0 is installed on the sever.
Then follow the following instruction to redirect HTTP requests to HTTPS on IIS 7 using URL Rewrite 2.0
1. Select the website you wish to configure from IIS manager.
2. In the “Features View” panel, double click URL Rewrite.
3. Click “Add Rules…” in the Actions menu to the right of the “Features View” panel.
4. Use the default “Blank rule” and press “OK”.
5. When editing a rule there are the “Name” field and 4 configuration pull down boxes.
– Enter “Redirect to HTTPS” in the name field.
6. Next we will configure the first configuration pull down box called “Match URL”, on the right side of “Match URL” press the down arrow to expand the box.
Within the “Match URL” configuration box we will set the following settings:
Requested URL: Matches the Pattern
Using: Regular Expressions
Pattern: (.*)
Using: Regular Expressions
Pattern: (.*)
7. We can now edit the next configuration pull down box which is “Conditions”, Press “Add…” to add a new condition to the configuration. We will configure the condition with the following settings:
Condition Input: {HTTPS}
Check if input string: Matches the Pattern
Pattern: ^OFF$
Check if input string: Matches the Pattern
Pattern: ^OFF$
8. Press “OK”
9. You should see your condition in the list of conditions.For this setting we do not need to configure the “Server Variables” pull down box.
10. Continue onto the “Action” configuration box and pull down the box by selecting the arrow on the right. We will configure the following settings for the “Action” configuration:
11. Press “Apply” then press “Back to Rules”
12. You should now see the rule configured on the main screen of the URL Rewrite module.
13. Test your site, it should now redirect from HTTP to HTTPS.
Post A Comment:
0 comments: