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?

Internet Information Services
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Lex Li (Microsoft) 6,032 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

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.