« Previous Next »

Not Answered Thread: URL Rewrite Module 1.1: statusDescription is not returned in a CustomResponse

Last post 05-21-2009 11:39 PM by peaceable_whale. 5 replies.

 

RSS

Page 1 of 1 (6 items)

Sort Posts:

  • 05-19-2009, 12:26 PM

    URL Rewrite Module 1.1: statusDescription is not returned in a CustomResponse

    To reproduce the issue, please prepare a HTTP response capturer, create a new folder in your web site, and create a web.config file with the following code:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    	<system.webServer>
    		<httpErrors existingResponse="PassThrough" />
    		<rewrite>
    			<rules>
    				<rule name="Test" stopProcessing="true">
    					<match url="test" ignoreCase="true" />
    					<action type="CustomResponse" statusCode="410" statusReason="Gone" statusDescription="The requested resource is no longer available at the server and no forwarding address is known." />
    				</rule>
    			</rules>
    		</rewrite>
    	</system.webServer>
    </configuration>

    Expected behavior:
    "The file has been removed." (The statusDescription) is returned.

    Actual result:
    HTTP/1.1 410 Gone
    Server: Microsoft-IIS/7.5
    Date: Tue, 19 May 2009 16:18:42 GMT
    Content-Length: 0

    (Nothing is returned in the response.)

    Franklin Tse (whale)
  • 05-21-2009, 5:04 AM In reply to

    • WWWWeb
    • Top 200 Contributor
    • Joined on 04-30-2009, 9:42 AM
    • Posts 52

    Re: URL Rewrite Module 1.1: statusDescription is not returned in a CustomResponse

    Below line makes the difference.

    <httpErrors existingResponse="PassThrough" />, if you replace it with "Replace" or "Auto", the description will be there.

     

  • 05-21-2009, 10:45 AM In reply to

    Re: URL Rewrite Module 1.1: statusDescription is not returned in a CustomResponse

    Unfortunately, no... If the setting is replaced by "Replace" or "Auto", the custom error will be replaced by IIS's error pages.

    Franklin Tse (whale)
  • 05-21-2009, 10:56 AM In reply to

    Re: URL Rewrite Module 1.1: statusDescription is not returned in a CustomResponse

    I have modified the statusDescription text to show the difference more clearly.

    Franklin Tse (whale)
  • 05-21-2009, 8:31 PM In reply to

    • WWWWeb
    • Top 200 Contributor
    • Joined on 04-30-2009, 9:42 AM
    • Posts 52

    Re: URL Rewrite Module 1.1: statusDescription is not returned in a CustomResponse

    Well, if you have this line in web.config,

     <httpErrors existingResponse="Replace" errorMode="Custom"/>

    IIS 7 always return follow text no matter what you specify for statusdescription which I belive it is the default IIS description for 410.

    "The page you requested was removed."

     

    If you have this line in web.config, IIS returns detailed error message with your statusdescription.

     <httpErrors existingResponse="Replace" errorMode="Detailed" />

    HTTP Error 410.1 - Gone

    The requested resource is no longer available at the server and no forwarding address is known.

     

    Is this meet your requirement?

  • 05-21-2009, 11:39 PM In reply to

    Re: URL Rewrite Module 1.1: statusDescription is not returned in a CustomResponse

    <httpErrors existingResponse="PassThrough" /> was set because I want to return some error messages generated by PHP. (http://forums.iis.net/t/1157703.aspx)

    How may I have both kinds of error messages displayed?

    Franklin Tse (whale)
Page 1 of 1 (6 items)