How to select 308 for a redirect in IIS 10 URL Rewrite

THEOBALD K 20 Reputation points
2025-04-01T22:13:56.7133333+00:00

I'm writing some rewrite rules in IIS 10, and want to add some redirects (namely, the standard HTTP-->HTTPS redirect). I've heard that for redirects, 308 is preferred to 301, as POST's aren't changed to GET's. But in the "Edit Inbound Rule" config page (in the IIS GUI), under Redirect type I only have the options 301, 302, 303, 307 -- no 308. Can I manually add 308 in the web.config file, and if so, what text should I use for the redirectType property in the XML?

Windows development | Internet Information Services
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Lex Li (Microsoft) 6,037 Reputation points Microsoft Employee
    2025-04-02T01:15:08.08+00:00

    While it seems that you might be able to locate and edit URL Rewrite module schema to add 308 to the list,

    https://github.com/lextm/iis_schema/blob/master/rewrite_schema.xml#L64

    testing shows that rewrite.dll itself has the options (301/302/303/307) hard coded. Thus, it won't accept your schema changes and will report 500 errors when you force it.

    Therefore, if you want 308 to be supported by URL Rewrite module, you should raise a feature request to Microsoft via the right channel.

    A workaround, however, is to use IIS HTTP Redirect and set HTTP status code to 308,

    https://learn.microsoft.com/en-us/iis/configuration/system.webserver/httpredirect/#configuration

    It can achieve HTTP to HTTPS redirection, but not as flexible as URL Rewrite in other occasions.

    0 comments No comments

  2. Tom Tran (WICLOUD CORPORATION) 10 Reputation points Microsoft External Staff
    2025-06-23T09:12:35.4666667+00:00

    Hi THEOBALD K,

    Unfortunately, no — IIS 10’s URL Rewrite module does not support HTTP 308, either through the GUI or by manually editing the web.config. The only valid values for the redirectType attribute are:

    • Permanent → 301
    • Found → 302
    • SeeOther → 303
    • Temporary → 307

    If you try to set redirectType="308" or any unsupported value, IIS will ignore it and result in 500 error code.

    This limitation is due to the fact that the URL Rewrite module hasn’t been updated to include support for newer status codes like 308, which was standardized in RFC 7538.

    If preserving the HTTP method is critical (e.g., for POST requests), here are your options:

    • Return 308 from your application code (e.g., in ASP.NET Core)
    • Use a reverse proxy like NGINX in front of IIS, which supports 308 natively and can handle the redirect before traffic reaches IIS.

    For more information, you can check out when you have the time:


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.