So, if I enter a URL, for example: http://sample.com/maindir/test123 , my Rewrite works fine. If I enter a URL, for example: http://sample.com/maindir/test123/test234 , it crashes giving a 500 error. Both of these work if I change it to a redirect instead of a rewrite rule
<rule name="Test" stopProcessing="true"> <match url="^maindir\/?(?:([^\/]+))?\/?(?:([^\/]+))?\/?(?:([^\/]+))?\/?(?:([^\/]+))?\/?" /> <action type="Rewrite" url="maindir/?a1[]={R:1}&a1[]={R:2}&a1[]={R:3}&a1[]={R:4}" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> </rule>
After much disappointment, trying to find a solution, I thought that I would see if anyone else could see what was happening here. Thank you in advance.
source share