我有这样的网址:
http://www.domain.com/index.php?route=product/product&path=someString&product_id=1111111
我需要将传入index.php的al请求重定向到以下内容:
http://www.domain.com/p/1111111/
我知道apache通过.htaccess的方法,但是如何在IIS7上实现呢?
发布于 2012-08-05 02:08:36
您应该能够使用IIS7 URL重写模块来完成此操作。
发布于 2012-08-06 03:18:00
尝试以下规则(我假设它是入站规则):
<rewrite>
<rules>
<rule name="SFRule" stopProcessing="true">
<match url="index\.php" />
<action type="Redirect"
url="/p/{C:3}"
appendQueryString="false"
redirectType="Found" />
<conditions>
<add input="{QUERY_STRING}"
pattern="route=([_0-9a-z-\/]+)(?:&|&)path=([A-Za-z]+)(?:&|&)product_id=([0-9]+)" />
</conditions>
</rule>
</rules>
</rewrite>https://serverfault.com/questions/414370
复制相似问题