Overwrite IIS with the query string and IIS 7 question mark

I read the topics, and I still can’t solve it, my problem is, I know, but I wonder if I can point me in the right direction.

I have a rule:

www.mydomain.com/productlist.asp?CategoryID=2

rewritten to

www.mydomain.com/homeware/cushions

.

            <rule name="cushions">
                <match url="^homeware/cushions" />
                <action type="Rewrite" url="productlist.asp?CategoryID=2" />
            </rule>

ok, now my problem is pagination of results, so the source domain when the user goes to the next page will look like this:

www.mydomain.com/productlist.asp?CategoryID=2&Page=2

This is where I have problems - I want this to become:

www.mydomain.com/homeware/cushions?page=2

and the current number of pages just can't get it to work - I understand that I need to use the query string, but it really fights. Request an expertise, thanks for any help

+3
source share
2 answers

, , URL- . , , :

<rule name="cushions" stopProcessing="true">
<match url="^homeware/cushions$" />
<conditions>
    <add input="{QUERY_STRING}" pattern="page=(\d+)" />
</conditions>
<action type="Rewrite" url="productlist.asp?CategoryID=2&amp;page={C:1}" appendQueryString="false" /> 

+1

appendQueryString = "true" , .

<rewrite>
        <rules>
            <rule name="test">
                <match url="^homeware/cushions" />
                <action type="Rewrite" url="/test/test.cfm?category=5" appendQueryString="true" />
                <conditions>
                </conditions>
            </rule>
        </rules>
    </rewrite>

http://localhost:8081/homeware/cushions?page=2 URL 2.

0

All Articles