Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I had urls like this:

http://www.domain.com/index.php?route=product/product&path=someString&product_id=1111111

and I need to redirect al requests coming to index.php to this:

http://www.domain.com/p/1111111/

I am aware of apache's methodology via .htaccess, but how do I do it on IIS7 ?

share|improve this question

2 Answers 2

You should be able to do this with the IIS 7 URL Rewrite module.

share|improve this answer

Try the following rule (I'm assuming it's an inbound rule):

<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;|&amp;amp;)path=([A-Za-z]+)(?:&amp;|&amp;amp;)product_id=([0-9]+)" />
      </conditions>
    </rule>
  </rules>
</rewrite>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.