{"id":799,"date":"2018-01-12T21:23:13","date_gmt":"2018-01-12T21:23:13","guid":{"rendered":"http:\/\/www.netexl.com\/blog\/?p=799"},"modified":"2026-04-02T10:02:32","modified_gmt":"2026-04-02T10:02:32","slug":"url-rewrite-seo-in-iis","status":"publish","type":"post","link":"https:\/\/www.netexl.com\/blog\/url-rewrite-seo-in-iis\/","title":{"rendered":"URL Rewrite SEO in IIS"},"content":{"rendered":"<p>Since the advent of search engines URL rewriting has become mandatory. It makes URLs look nicer and clearer in terms of what content to\u00a0expect at the given URL. Recently I uploaded few static HTML files to an IIS site. I wanted a nice looking URL without .html extension which was quite straight-forward to achieve in ASP.NET site. You can install <span style=\"text-decoration: underline;\">URL Rewrite Module<\/span>\u00a0in IIS 7 or above versions and a few configuration steps is all that is required to achieve the desired results.<\/p>\n<p>Read <a href=\"https:\/\/docs.microsoft.com\/en-us\/iis\/extensions\/url-rewrite-module\/creating-rewrite-rules-for-the-url-rewrite-module\" target=\"_blank\">this<\/a> article from Microsoft to get in-depth understanding of the steps. Below is the sample web.config entry I had to make to achieve the results<\/p>\n<pre class=\"lang:default decode:true\">&lt;configuration&gt;\r\n\r\n  &lt;system.webServer&gt;\r\n\r\n    &lt;rewrite&gt;\r\n      &lt;rules&gt;\r\n        &lt;rule name=\"Rewrite to .html Rule\"&gt;\r\n          &lt;match url=\"^games\/([_0-9a-z-]+)\" \/&gt;\r\n          &lt;action type=\"Rewrite\" url=\"games\/{R:1}.html\" \/&gt;\r\n        &lt;\/rule&gt;\r\n      &lt;\/rules&gt;\r\n    &lt;\/rewrite&gt; \r\n\r\n  &lt;\/system.webServer&gt;\r\n\r\n&lt;\/configuration&gt;<\/pre>\n<p>You will need some understanding of the regular expressions to create a matching pattern for your URL (match tag in web.config) and map it to actual resource on the server which is defined in action tag. Here I am simply looking to match following condition for the URL<\/p>\n<ol class=\"lf-text-block lf-block\" data-lf-anchor-id=\"a91c446fbb5be33b3fe928854142cf13:0\">\n<li class=\"\">Starts with the sequence of characters &#8220;games\/&#8221;.<\/li>\n<li class=\"\">Contains one or more alphanumeric or &#8220;_&#8221; or &#8220;-&#8221; characters after the\u00a0first &#8220;\/&#8221;.<\/li>\n<\/ol>\n<p>And within 5 mins of effort I had a nice looking SEO friendly URL.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since the advent of search engines URL rewriting has become mandatory. It makes URLs look nicer and clearer in terms of what content to\u00a0expect at the given URL. Recently I uploaded few static HTML files to an IIS site. I wanted a nice looking URL without .html extension which was quite straight-forward to achieve in ASP.NET site. You can install URL Rewrite Module\u00a0in IIS 7 or above versions and a few configuration steps is all that is required to achieve the desired results. Read this article from Microsoft to get in-depth understanding of the steps. Below is the sample web.config entry I had to make to achieve the results &lt;configuration&gt; &lt;system.webServer&gt; &lt;rewrite&gt; &lt;rules&gt; &lt;rule name=&#8221;Rewrite to .html Rule&#8221;&gt; &lt;match url=&#8221;^games\/([_0-9a-z-]+)&#8221; \/&gt; &lt;action type=&#8221;Rewrite&#8221; url=&#8221;games\/{R:1}.html&#8221; \/&gt; &lt;\/rule&gt; &lt;\/rules&gt; &lt;\/rewrite&gt; &lt;\/system.webServer&gt; &lt;\/configuration&gt; You will need some understanding of the regular expressions to create a matching pattern for your URL (match tag in[&#8230;]<\/p>\n","protected":false},"author":5,"featured_media":1540,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,14,8],"tags":[],"class_list":["post-799","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-asp-net","category-how-to","category-seo"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/comments?post=799"}],"version-history":[{"count":2,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/799\/revisions"}],"predecessor-version":[{"id":802,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/799\/revisions\/802"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/media\/1540"}],"wp:attachment":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/media?parent=799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/categories?post=799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/tags?post=799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}