Quantcast
Channel: Configuration & Scripting
Viewing all articles
Browse latest Browse all 780

appcmd command for URL rewrite rules.

$
0
0

Hi,

I wants to create the follwoing URL Rewrite rule using appcmd.exe command. (IIS Version : 10.0 )

<rewrite>
<rules>
<rule name="ME Rewrite Rule" stopProcessing="true">
<match url="^meopsapi/(.*)$" />
<action type="Rewrite" url="meops/meops_apiindex.php?request={R:1}" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
</rule>
</rules>
</rewrite>

When I use the following command:
appcmd.exe set config "Default Web Site/me" -section:system.webServer/rewrite/rules -[name='ME Rewrite Rule'].match.url:match url="^meopsapi/(.*)$"

I am getting error : "ERROR ( message:Cannot find requested collection element. )"

Can someone please help me to form the appcmd commands for creating the above URL Rewrite rules shown in the XML snippet?

Thanks in advance.
Unnikrishnan


Viewing all articles
Browse latest Browse all 780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>