2

I have this URL www.example.com/music/in/chicago

And none of the rewrite rules in placed in my rewriteRules.config below match the above URL....what am I missing?

<rules>
<clear />
<rule name="music search city hardcode">
  <match url="^/music/in/chicago"/>
  <action type="Rewrite" url="contact.aspx"/>
</rule>
<rule name="music search city">
  <match url="^/music/in/([a-zA-Z-+.']+)"/>
  <action type="Rewrite" url="search.aspx?cityurl={R:1}&amp;t=2"/>
</rule>

<rule name="music search city 2">
  <match url="^\/music\/in\/([a-zA-Z-+.']+)"/>
  <action type="Rewrite" url="search.aspx?cityurl={R:1}&amp;t=2"/>
</rule>

<rule name="music search city 3">
  <match url="^/music/in/([a-zA-Z-+.']+)"/>
  <action type="Rewrite" url="search.aspx?cityurl={R:1}&amp;t=2"/>
</rule>

<rule name="music search city 4">
  <match url="^\/music\/in\/([a-zA-Z-+.']+)$"/>
  <action type="Rewrite" url="search.aspx?cityurl={R:1}&amp;t=2"/>
</rule>

<rule name="music search city 5">
  <match url="^music/in/([a-zA-Z\-+.']+)$"/>
  <action type="Rewrite" url="search.aspx?cityurl={R:1}&amp;t=2"/>
</rule>

<rule name="music search city 6">
  <match url="^music\/in\/([a-zA-Z-+.']+)$"/>
  <action type="Rewrite" url="search.aspx?cityurl={R:1}&amp;t=2"/>
</rule>   

<rule name="final rule">
  <match url="^(fornitori|vendors)/(musica|music)/c/([a-zA-Z0-9-+']+)/([a-zA-Z0-9-+']+)/([a-zA-Z0-9-+' ]+)$"/>
  <action type="Rewrite" url="search.aspx?countryurl={R:3}&amp;provinceurl={R:4}&amp;cityurl={R:5}&amp;t=2" appendQueryString="true"/>
</rule>

</rules>

update

I added rule hardcode to redirect to a different page and even that does not work...I'm really confused now

2
  • Where is your Web.config file? Assuming in the document root then I would have expected rule #5 to match, except the hyphen (-) after the Z should really be backslash escaped to match a literal hyphen. Commented Nov 29, 2015 at 22:48
  • @w3d thanks! I changed my post with rules locations and your suggestion...but with that added, still there's no match on rule #5 and the weird thing is that rule final rule seems to be triggered Commented Nov 29, 2015 at 22:57

1 Answer 1

2

Turns out Chrome was caching my requests! I found this out when running Chrome in incognito mode. I now start Chrome with parameter --disk-cache-dir=null, so: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disk-cache-dir=null.

2
  • 1
    You can also test with the Object Inspector open and check the "Disable Cache" option on the Network tab. Commented Nov 30, 2015 at 10:19
  • @w3d Ah, even better :) Commented Nov 30, 2015 at 13:59

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.