我有这样的url:
http://www.domain.com/index.php?route=product/product&path=someString&product_id=1111111
我需要将来自index.php的请求redirect到:
http://www.domain.com/p/1111111/
我知道apache的方法通过.htaccess,但我怎么在IIS7上做到这一点?
您应该可以通过IIS 7 URL重写模块来执行此操作。
尝试下面的规则(我假设它是一个入站规则):
<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-\/]+)(?:&|&amp;)path=([A-Za-z]+)(?:&|&amp;)product_id=([0-9]+)" /> </conditions> </rule> </rules> </rewrite>