May 22, 2012
tom

Ignoring HTTP 1.0 requests in IIS

Question

Is there a way to ignore HTTP 1.0 requests in IIS (7.0)? I don’t see any reason to accept requests that are not HTTP 1.1.

Asked by Mark Richman

Answer

Step 1: download and install URL Rewrite.
Step 2: add the following to your web.config file, to the <system.webServer> section:

<rewrite>
    <rules>
        <rule name="RequestBlockingRule1" patternSyntax="Wildcard" stopProcessing="true">
            <match url="*" />
            <conditions>
                <add input="{SERVER_PROTOCOL}" pattern="HTTP/1.0" />
            </conditions>
            <action type="AbortRequest" />
        </rule>
    </rules>
</rewrite>

This will refuse all HTTP 1.0 requests with a HTTP 504 error code.

Edit: after installing URL Rewrite, you can also configure rewrite rules in IIS Manager:

enter image description here

Answered by n/a

Related posts:

  1. Using IIS 7.5 URL Rewrite, how can I redirect all requests not from a particular subdomain to a specific page?
  2. Redirect users from HTTPS to HTTP via IIS and the web.config file
  3. Redirect incoming requests to specific URLs in IIS 7
  4. Help with IIS rewrite rule
  5. Can I configure IIS 7+ to do a dynamic reverse proxy based on the incoming hostname?

Leave a comment