Hi,
I have a dynamic page that recives and ID through the adress bar - www.yyy.com/play.php?name=some name$id=5
i want to configure my web.config to rewrite the adress to www.yyy.com/some-name.html
At the moment im getting the correct URL but the id is not posted to the page.
What am I doing wrong ?
this is the code i currently have on my web.config
<rules>
<rule name="RedirectUserFriendlyURL1" stopProcessing="true">
<match url="^play\.php$" />
<conditions>
<add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
<add input="{QUERY_STRING}" pattern="^name=([^=&]+)&id=([^=&]+)$" />
</conditions>
<action type="Redirect" url="{c:2}.html" appendQueryString="false" />
</rule>
<rule name="RewriteUserFriendlyURL1" 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="play.php?name={R:1}&id={R:2}" />
</rule>
</rules>
I have a dynamic page that recives and ID through the adress bar - www.yyy.com/play.php?name=some name$id=5
i want to configure my web.config to rewrite the adress to www.yyy.com/some-name.html
At the moment im getting the correct URL but the id is not posted to the page.
What am I doing wrong ?
this is the code i currently have on my web.config
<rules>
<rule name="RedirectUserFriendlyURL1" stopProcessing="true">
<match url="^play\.php$" />
<conditions>
<add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
<add input="{QUERY_STRING}" pattern="^name=([^=&]+)&id=([^=&]+)$" />
</conditions>
<action type="Redirect" url="{c:2}.html" appendQueryString="false" />
</rule>
<rule name="RewriteUserFriendlyURL1" 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="play.php?name={R:1}&id={R:2}" />
</rule>
</rules>