0
這是我的代碼,在這段代碼中我得到了request.querystring(「id」)eg。 www.site.com/q如何獲得所有request.querystring一個接一個
但我需要所有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>
在這個代碼<動作類型=「重寫」 URL =「?id = {R:0} & {QUERY_STRING}」appendQueryString =「false」/> id是默認的第一個查詢名稱我如何設置下一個查詢名稱? – MRRaja
例如url:www.site.com/a(a是id值),但我需要www.site.com/a/b(如何設置b的查詢名稱?) – MRRaja
您是否在談論IIS中的URL重寫模塊(http://www.iis.net/downloads/microsoft/url-rewrite) - 做你在問什麼,你不會在ASP代碼中做到這一點,你在IIS –