hep - web.config rewrite

Joined
Sep 28, 2011
Messages
2
Reaction score
0
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=([^=&amp;]+)&amp;id=([^=&amp;]+)$" />
</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}&amp;id={R:2}" />
</rule>
</rules>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top