Redirect short URL to FQDN to avoid Certificate error

Last Updated: 06 August 2021

I had a problem where an internal site URL was throwing the ubiquitous certificate error as seen in the image below. This is simply because the URL is not fully qualified. 

Since it is impossible to ask non-technical users to edit the URL, the best way to solve this issue is to Rewrite the URL. 

This solution was implemented on Microsoft IIS 10.0 installed on Windows Server 2019.

not trusted

To Rewrite the URL, download the URL Rewrite module for IIS from Microsoft using the URL below:

https://www.iis.net/downloads/microsoft/url-rewrite

iis_rewrite_module
  • Close IIS and install the Rewrite module 
  • Launch IIS URL Rewrite module
iis_rewrite_module
  • Create a blank rule by clicking on “Blank rule”
iis_rewrite_module_blank_rule
  • Give the rule a name and follow the image below for other settings
iis_rewrite_module_blank_rule
  • Under “Add condition”, follow the settings below replacing the “domain” and “com” with your own setting
iis_rewrite_module_blank_rule
  • Under the Action pane, select Redirect as Action type and enter the Redirect URL as shown in the image below replace “domain.com” with your own domain and set the Redirect type as Permanent (301)
iis_rewrite_module_blank_rule