IIS Rewrite Rules & Resources
- Add Caching for Static Assets (IIS) - Increase performance and reduce bandwidth use by adding caching directives that browsers will use to cache static assets client side.
- Add/Remove Trailing Slash (IIS) - Add or remove the trailing slash in URLs to enforce consistent URL structure, good for SEO.
- Canonicalize Host – Add/Remove www (IIS) - Canonicalize host name to enforce either a www-prefixed domain or non-www-prefixed domain.
- Enable GZip Compression (IIS) - Reduce file sizes and increase response performance by enabling GZip compression of text-based responses.
- Enable/Disable Directory Browsing (IIS) - Turn directory browsing on or off. Can prove useful during development.
- Enforce Lower Case URLs (IIS) - Force URLs to lowercase, especially important for SEO on Windows-based servers, which are case-insensitive.
- Keep Rewrite Rules In Separate File (IIS) - Keep your rewrite rules outside of web.config with this simple technique.
- Manage Static Rewrite Rules with RewriteMaps (IIS) - Centrally manage any number of redirect and rewrite rules by leveraging an external RewriteMap configuration file.
- Prevent Image Hotlinking (IIS) - Prevent other sites from using your images as their own.
- Redirect All HTTP Requests To HTTPS (IIS) - Redirect all non-HTTPS requests to use an HTTPS connection.
- Redirect Default Document to Directory (IIS) - Redirect all requests to a default document to its parent directory URL. Important SEO tactic to avoid duplicate content penalties.
- Redirect Directories to Another Directory (IIS) - Redirect all requests to one or more directories to another directory. Useful if restructuring content on a site.
- Redirect Domain to Another Domain (IIS) - Redirect all requests to one domain to another domain. Useful if changing domain names for a site.
- Reverse Proxy To Another Server (IIS) - Proxy an intranet, or other, server's content through a different webserver.
- Rewrite URL as Query String Parameters (IIS) - Create SEO friendly URLs by tokenizing the URL into query_string parameters.
- SEO Friendly URLs in WordPress (IIS) - Yes, you can run Wordpress in IIS and have SEO-friendly URLs.
- Whitelist/Blacklist IP Addresses (IIS) - Only allows requests from a specified set of IPs. Useful when a site is under development or maintenance.
Articles & Resources
- Configure an IIS Rewrite Rule from PowershellProgrammatically create rewrite rules from Powershell.
- How to Import Apache Rewrite Rules into IISHow to import and convert Apache rewrite rules for use in IIS.
- IIS Compression Installation DetailsInstructions for installing and configuring compression in IIS.
- IIS Compression OverviewA detailed overview of compression features in IIS, how to configure, and more.
- IIS Redirect and Postman Tests GeneratorGenerate redirect rules and Postman tests from a spreadsheet.
- URL Rewrite Module Configuration ReferenceAn overview of the URL Rewrite Module and explains the configuration concepts that are used by the module.
- Web.config ValidatorHelps you find and correct errors in web.config files.
IIS (Internet Information Services) is a web server that runs on the Microsoft .NET platform on the Windows operating system (despite being possible to run IIS on Linux and Macs using Mono, it’s not a recommended practice). While IIS had a much larger share of the market in the past, it currently boasts about 10% of the web servers on the Internet.