
When you stop the IIS application pool for your web site, IIS will return HTTP 503 for all requests to that site.
#IIS 10 URL REWRITE DOWNLOAD CODE#
This status code implies that the outage is temporary, so when search engine crawler gets HTTP 503 response from your site, it will know not to index this response, but instead to come back later. HTTP status code 503 means that the server is currently unable to handle the request due to maintenance. If you do not want to do that, then you can create two web sites in IIS – one with http binding and another with https binding – and then add this rule to the web.config file of the site with http binding. Note that for this rule to work within the same web site you will need to disable “Require SSL” checkbox for the web site. With URL Rewrite Module you can perform this kind of redirection by using the following rule: If you follow it you will see that browser gets redirected to. Instead you would want to redirect them to the secure equivalent of the URL they have requested. But if you want your site to be easily discoverable and more user friendly, you probably would not want to return 403 response to visitors who came over unsecure HTTP connection. This may be fine if you always expect that your site visitors will be typing “ in the browser’s address bar. When a site that requires SSL is accessed via non-secure HTTP connection, IIS responds with HTTP 403 (Unauthorized) status code. You will see in the browser’s address bar that “Redirect to HTTPS To see an example of how that works try browsing to. A very simple redirect rule will take care of that: Or, perhaps, you have recently changed you domain name from to and you want your visitors to use new domain name when bookmarking links to your site. The most common example is when a site can be accessed via and via. Very often you may have one IIS web site that uses several different host names.

What you want to do is to ensure that if somebody comes to your web site by using a non-canonical link, then you redirect them to the canonical URL that uses only lowercase characters: In this case again the search crawlers will treat the same page as two different pages and two different statistics sets will show up in Web Analytics reports. To always add trailing slash to the URL: Ī problem similar to the trailing slash problem may happen when somebody links to your web page by using different casing, e.g. To always remove trailing slash from the URL: Having or not having a trailing slash in the URL is a matter of taste, but once you’ve made a choice you can enforce the canonical URL format by using one of these rewrite rules: This problem is very easy to fix with a rewrite rule. They will also cause Web Analytics statistics for this page to be split up. Different URLs for the same page may cause crawlers to treat the same page as different pages, thus affecting the page ranking. That is OK for human visitors, but may be a problem for search engine crawlers as well as for web analytics services. If you try to request these URLs with or without trailing slash you will still get the same page. An example of such application may be an ASP.NET MVC application with URL format similar to this: or a PHP application with URL format that looks like this. Many web applications use “virtual URLs” – that is the URLs that do not directly map to the file and directory layout on web server’s file system.


Return HTTP 503 Status Code in Response.

Each tip/trick has a description of a problem and then an example of how it can be solved with IIS 7 URL Rewrite Module. This post describes some of the tips and tricks that one may find useful when solving URL-based problems for their web server or web site.
