How to convert URL "http to https" by using IIS URL Rewrite Module-2.0 Tools in Windows Webserver & and cloud-based sites.

Summary: Using the IIS URL Rewrite Module allows you to create rules to map incoming web requests to more user-friendly URLs or to perform redirects. This is commonly used for SEO purposes, simplifying URLs, or redirecting traffic. Here's how to use the IIS URL Rewrite Module for both physical web servers and cloud-based sites.

Prerequisites: -

  • IIS Web Server installed (for physical servers).
  • IIS URL Rewrite Module installed on the server.
  • Access to Azure, AWS, Google Cloud, or other cloud hosting platforms if working with cloud-based sites.

Installation Process for the Physical Web Server (IIS): -

Step 01: Installing the IIS URL Rewrite Module: -
  • Download the IIS URL Rewrite Module from the official Microsoft website.
  • Install the module on your web server.
  • Verify that the module is enabled in the IIS Manager under the website's Modules section.

Step 02: Configuring URL Rewrite in a Physical Web Server: -

  • Open IIS Manager and navigate to the desired website or application.
  • Double-click on the URL Rewrite icon to open the configuration page.
  • Click on Add Rule(s)... from the right panel to create a new rule.
  • Choose from the available templates:
    • Blank Rule: For a custom rule with specific conditions.
    • Redirect: To set up HTTP to HTTPS redirection or redirect old URLs to new ones.
    • Rewrite: For rewriting URLs without changing the address shown in the browser.
  • Define the Match URL conditions:
    • Specify the pattern to match, such as ^old-path/(.*) to catch any requests to a certain directory.
    • Set the conditions based on the request, if necessary.
  • Set the Action type:
    • Redirect: To send the user to a different URL (e.g., https://new-site.com/{R:1}).
    • Rewrite: To serve content from a different URL without changing the visible URL (e.g., /{R:1}).
    • Abort Request or Custom Response can be used for blocking specific patterns.
  • Click Apply to save the rule.

Step 03: Deploying IIS URL Rewrite in IIS Webserver Environments: -

  • your web app with a web.config file that includes the rewrite rules.
  • Example web.config for URL rewriting
web.config

"web. config"
  • Ensure that the web.config file has been deployed to the wwwroot directory or the application directory on your instance.
  • Depending on the cloud service you are using (Azure, AWS, or Google Cloud), the setup may vary slightly.








    Google Translate Integration

    Comments