We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

rewrite causing 500 errorsRSS

3 replies

Last post Mar 04, 2020 02:43 AM by Jalpa Panchal

  • rewrite causing 500 errors

    Feb 04, 2020 02:02 PM|stevelogan|LINK

    IIS 10, Windows 2K16, URL Rewrite 2.1.  The server has about 6 sites on it, 2 of which us rewrite rules.  Site #1 ran fine with it's rewrite rules until about 2 weeks ago when it would start go give random 500 errors.  We enabled failed request tracing which shows the error below.  When we disable the rules and access the URL directly, the error goes away, which is what we did on site #1.  #2 is our API and is a bit more complex to just eliminate the rules from.  The rewrite rules look like this:

    <div style="color: #d4d4d4; background-color: #1e1e1e; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 15px; line-height: 20px; white-space: pre;"> <div><httpErrors existingResponse="PassThrough" /></div> <div>        <rewrite></div> <div>            <rules></div> <div>                <rule name="ApiWithControllerAndId" stopProcessing="true"></div> <div>                    <match url="^([^/]+)/([^/]+)/([^/]+)/?$" /></div> <div>                    <conditions></div> <div>                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /></div> <div>                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /></div> <div>                    </conditions></div> <div>                    <action type="Rewrite" url="index.cfm?controller={R:1}&amp;method={R:2}&amp;id={R:3}" /></div> <div>                </rule></div> <div>                <rule name="ApiWithController" stopProcessing="true"></div> <div>                    <match url="^([^/]+)/([^/]+)/?$" /></div> <div>                    <conditions></div> <div>                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /></div> <div>                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /></div> <div>                    </conditions></div> <div>                    <action type="Rewrite" url="index.cfm?controller={R:1}&amp;method={R:2}" /></div> <div>                </rule></div> <div>            </rules></div> <div>        </rewrite></div> </div>

    All other sites that do not use rewrite in URL rewrite (we have some redirct rules but they're not effected) work fine.  The API site also works fine on a different, identical server.  At this point I'm out of ideas as to where to even look.  Tomcat indicates an IIS issue, IIS support people say it's a Tomcat issue etc.

    <div class="content-container"> <div class="hidden" id="section_detail" style="display: block;">
    <div id="section_detail_52_details">
    FilterName D:\ColdFusion2018\config\wsconfig\1\isapi_redirect.dll
    <div class="duration">0 ms</div> 53. -FILTER_END <div id="section_detail_53_details">
    NotificationStatus SF_STATUS_REQ_ERROR
    <div class="duration">0 ms</div> <div class="severity-error">Error</div> 54. -FILTER_ERROR <div id="section_detail_54_details">
    ErrorCode Incorrect function. (0x1)
    <div class="duration">0 ms</div> <div class="severity-informational">Informational</div> 55. -FILTER_AUTH_COMPLETE_END <div id="section_detail_55_details">
    <div class="duration">0 ms</div> <div class="severity-warning">Warning</div> 56. -MODULE_SET_RESPONSE_ERROR_STATUS <div id="section_detail_56_details">
    ModuleName IsapiFilterModule
    HttpStatus 500
    HttpReason Internal Server Error
    HttpSubStatus 0
    ErrorCode Incorrect function. (0x80070001)
    <div class="duration">0 ms</div> <div class="severity-verbose">Verbose</div> 57. -NOTIFY_MODULE_END <div id="section_detail_57_details">
    ModuleName IsapiFilterModule
    fIsPostNotificationEvent true


    </div> </div>
  • Rovastar Rovastar

    5495 Posts



    Re: rewrite causing 500 errors

    Feb 04, 2020 07:16 PM|Rovastar|LINK

    Well the error seems to be in the isapi_redirect.dll  which is a Tomcat redirection dll.

    Which for me it is in their camp.

    It seems like using the Microsofts URLrewrite module is probably changing something before it get there and the Tom redirect dll doesn't understand it.

    Compare the details (in failed request tracing) in the request  after it has done the URLrewrite part to a request when you have disabled the rule.

    I expect suitable differences there,

    Troubleshoot IIS in style
  • Re: rewrite causing 500 errors

    Feb 05, 2020 08:17 AM|Jalpa Panchal|LINK


    This is the tomcat related issue. you could try to use the arr instead of the tomcat redirector. The error code ERROR_INVALID_FUNCTION is generated by the ISAPI filter.

    you could also try to follow this below article:




    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: rewrite causing 500 errors

    Mar 04, 2020 02:43 AM|Jalpa Panchal|LINK


    Is your issue solved?

    If your issue is solved then I request you to mark the helpful suggestion as an answer. This will help other people who face the same issue.

    If your issue still exists then try to refer the solution given by the community members.

    If then also you have any further questions then let us know about it.

    We will try to provide further suggestions to solve the issue.

    Thanks for your understanding.



    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.