URL Rewrite Module 2.0.URL rewrite module is a plug-in for IIS7 and above that allows to manipulate url’s.
And run the below command
appcmd set site “Site name in IIS” /+bindings.[protocol='https',bindingInformation='*:443:a.contoso.com']
http://a.contoso.com default https://a.contoso.com
- Ensure that the certificate is installed in IIS and the cert is present in the Personal Certificate store of the computer.
- Bind the certificate to a SSL port
And run the below command
appcmd set site “Site name in IIS” /+bindings.[protocol='https',bindingInformation='*:443:a.contoso.com']
- Install the URL REWRITE MODULE 2.0. You can download from MS site.
- Add a alternate access mapping in Sharepoint like below
http://a.contoso.com default https://a.contoso.com
- I assume the site is browse-able now on https. Now I am going to create a url rewrite rule to redirect from http to https
- Open the IIS manager. Select the site you want to configure redirect. Go to the featuresPanel and double click URL Rewrite
- You will notice there are currently no rules configured for this site. Click “Add Rules…” in the Actions menu to the right of the “Features View” panel
- Use the default “Blank rule” and press “OK”.
When editing a rule there are the “Name” field and 4 configuration pull down boxes.
- Enter “Redirect to HTTPS” in the name field.
- 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: (.*)
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$
Press “OK”
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. 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:
Action Type: Redirect
Redirect URL: https://{HTTP_HOST}/{R:1}
Redirect Type: Select Permanent (301)
Press “Apply” then press “Back to Rules”
You should now see the rule configured on the main screen of the URL Rewrite module.
Test your site, it should now redirect from HTTP to HTTPS.
No comments:
Post a Comment