URL Rewrite - HTTP to HTTPS redirection for MachPanel Web Portal


Summary

This article provides information about steps to perform HTTP to HTTPS redirection for MachPanel Web Portal.

Applies To

Applies to MachPanel v6 and onward.

Steps to perform
  • DOWNLOAD AND INSTALL

Download “URL Rewrite” from https://www.iis.net/downloads/microsoft/url-rewrite by clicking “Install this extension”:

You will be asked to “Save File”

Double Click the file after downloading it:

Hit “Run” if you get a security prompt:

Initialization will start:

Hit Install button:

Accept the terms:

Installation begins:

Hit Finish when done and exit installer:

  • CONFIGURATION AND TEST

Open / Re-Open IIS Manager to see URL Rewrite module under IIS section:

 Click on “MachPanel Control Server” website under Sites and double click “URL Rewrite”:

Hit “Add Rule (s)”:

Select Blank rule in the Inbound rules section, then click the OK button.

Give your redirect an easy-to-remember name.

In the Matched URL section:
o    Set Requested URL: to Matches the Pattern.
o    Set Using to Regular Expressions.
o    Enter (.*) as the Pattern.
o    Check Ignore case.

Scroll down to Conditions and expand the section if necessary. Select Match All for Logical grouping, then click the Add… button.

A dialog box will open:
•    Type {HTTPS} in the Condition input field.
•    Set Check if input string to Matches the Pattern.
•    Type ^OFF$ in the Pattern field.
•    Check Ignore case.
•    Click the OK button.

You should now see your condition in the list.

Scroll down to the Action section and enter these settings:
•    Select Redirect as the Action type.
•    Type https://{HTTP_HOST}/{REQUEST_URI} in the Rewrite URL field.
•    Uncheck Append query string.
•    Set Redirect type to Permanent (301).

Click Apply in the right-hand Actions menu.

You can now check your redirect in a web browser.

  • TROUBLESHOOT

If there are any problems, you can check the site’s web.config file to make sure it contains the correct information.
In IIS Manager, right-click your site and choose Explore from the menu.

Edit web.config or open it in a text editor.

Verify that web.config contains the following text. If necessary you can create and/or modify this file:

Note: above details should fall just above in the web.config:   
</system.webServer>