IIS URL url not working after first slash, but url works fine

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}&amp;a1[]={R:2}&amp;a1[]={R:3}&amp;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.

+5
source share

Source: https://habr.com/ru/post/1242380/


All Articles