Ian Boyd
Ian Boyd

Reputation: 256591

How to redirect (307 Temporary Redirect) with UrlRewriter?

i've created a rule using UrlRewriter to perform a redirect:

<rewriter>
   <redirect url="~/ResetClock.ashx" to="~/ResetClock" />
</rewriter>

The problem is that it is issuing a 301 Moved Permanantly redirect:

POST /ResetClock.asp HTTP/1.1

HTTP/1.1 301 Moved Permanently
Location: /ResetClock

i can mark the redirect as "temporary" redirect:

<rewriter>
   <redirect url="~/ResetClock.ashx" to="~/ResetClock" permanent="false" />
</rewriter>

In which case it incorrectly issues a 302 Found redirect:

POST /ResetClock.asp HTTP/1.1

HTTP/1.1 302 Found
Location: /ResetClock

The problem is that both of these redirects are the wrong redirect to issue. i need UrlRewriter to issue a:

307 Temporary Redirect

How can i do that?

Note: The reason i need it to issue a 307, is the reason 307 (and 303) were invented: all browsers handle 302 incorrectly; converting a POST into a GET. i need to tell the User-Agent that they need to post elsewhere:

POST /ResetClock.ashx HTTP/1.1

HTTP/1.1 307 Temporary Redirect
Location: /ResetClock

and the client will issue the redirect to the correct location.

Upvotes: 1

Views: 411

Answers (0)

Related Questions