locked
Need help with exception pattern RRS feed

  • Question

  • User-1430697987 posted

    I currently have a rule which rewrites the index.php in my application. The rule is below

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <rewrite>
                <rewriteMaps>
                    <rewriteMap name="/index.php" />
                </rewriteMaps>
            <rules>
                 <rule name="Clean URL" stopProcessing="true">
                    <match url="^(.*)$" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
                </rule>
            </rules>
            </rewrite>
        </system.webServer>
    </configuration>

    This works fine. What I have now is an application which would fall under the root default web site in which I don't want the rule to apply. The uri would look like this

    https://web01.mydomain.com/arcserver/rest/services/*

    When the rule is in place it gets changed to this

    https://web01.mydomain.com:443/index.php/arcserver/rest/services

    This has to do with arcgis so I think there is some sort of mod-rewrite going on within the app, but there is no way to access it. So basically I want to keep the rule in place for everything except for these rest requests. I am not very good with regex and still a beginner when it comes to the web.config

    Thanks in advance


    Ray

    Thursday, September 21, 2017 1:26 PM

All replies

  • User-460007017 posted

    Hi craygo,

    Do you want to add the exception for https://web01.mydomain.com/arcserver/rest/services/*. You could use this  condition pattern for:

    <conditions>
                            <add input="{URL}" pattern="^/arcserver/rest/services/(.*)$" negate="true" />
                        </conditions>

    Best Regards,

    Yuk Ding

    Friday, September 22, 2017 3:13 AM