这是我的代码,在这段代码中我得到了request.querystring(“id”)例如。 www.site.com/q
但是我需要所有的request.querystring来用不同的名字,例如。 www.site.com/q1/q2/q3/q4
如何设置所有request.querystring名称并通过此we.config获取数据?
<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="DeduplicateSlashes" stopProcessing="true">
<match url="." ignoreCase="false" />
<conditions>
<add input="{URL}" pattern="^(.*)//(.*)$" ignoreCase="false" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="{C:1}/{C:2}" />
</rule>
<rule name="CleanRouting" stopProcessing="true">
<match url="^.*$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="?id={R:0}&{QUERY_STRING}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
<!-- Double escaping is needed for URLs with '+', e.g. for the account page for a username with a space. -->
<security>
<requestFiltering allowDoubleEscaping="true" />
</security>
</system.webServer>
</configuration>
答案 0 :(得分:1)
我不太确定你在web.config中想要什么,但这会得到你所有的查询字符串对:
Dim item
For each item in Request.Form
Response.Write "Name: " & item & " Value= " & Request(item)
Next