我有一个url '/quote/details/e4dd5f4e4c705436ba381b0dc06fccc0'重写为:'/quote/details/?retrieveQuote = e4dd5f4e4c705436ba381b0dc06fccc0 '
<rule name="Rewrite Saved Quote to Query String Type" stopProcessing="false">
<match url="^quote/details/([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="quote/details/?retrieveQuote={R:1}" appendQueryString="true" />
</rule>
这是有效的,因为当我把stopProcessing设置为true时,我得到一个404和正确的输出:请求的URL报价/详细信息/?retrieveQuote = e4dd5f4e4c705436ba381b0dc06fccc0
现在应该像站点的其他部分一样使用以下方式重写:
<rule name="Rewrite to Index" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{URL}" pattern="/admin/+" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="/api/+" ignoreCase="false" negate="true" />
<add matchType="IsFile" negate="true" />
<add matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
但由于某种原因,它没有,如果我使用$_SERVER['REQUEST_URI']它打印:quote/details/e4dd5f4e4c705436ba381b0dc06fccc0,但应该是:quote/details/?retrieveQuote = e4dd5f4e4c705436ba381b0dc06fccc0
有什么办法让它正确工作吗?
我找不到任何解决方案,所以我创建了一个路由规则,并从URL中拆分所需的参数