Rule templates in URL Rewrite module provide a simple way of creating one or more rewrite rules for a certain scenario.
Built-in rule templates
URL rewriter module includes several rule templates for most common scenarios:
- User Friendly URL - This rule template can be used to generate rewrite and redirect rules that make URLs for your dynamic web application more user and search engine friendly. The rule template helps you generate rewrite rule that transform the hierarchy based URLs to URLs with query strings. Also, optionally, it can generate a redirect rule that can be used to redirect web clients form URLs with query strings to clean URLs.
- Rule with Rewrite Map - This rule template can be used to generate rewrite and redirect rules that use rewrite maps for storing static mappings between originally requested URLs and rewritten or redirected URLs. For more information about usage of rewrite maps refer to "URL Rewrite Module Configuration Reference" and "Using Rewrite Maps in URL Rewrite Module".
- Request Blocking - this rule template can be used to generate a rule that blocks incoming requests based on various criteria. For example, requests can be blocked based on certain pattern within URL path or based on certain value in one of the request headers.
Custom rule templates
URL Rewrite module provides an extensible framework for plugging in custom rule templates. For example, you could create a rule template that simplifies creation of rewrite rules for search engine optimization of the web site or for preventing content hot-linking. For a step by step guidance on how to extend URL Rewrite module user interface with rule templates refer to the article "Developing rule template for URL Rewrite module".