I cannot figure out how to solve this problem when rewriting a URL:
URLs after this pattern
app /(.*)
should redirect to app / index.cshtml
However, the application folder contains resources such as subfolders, js files, and html files. They should be ignored and no redirection should be made.
Here's how Ive done it:
<rewrite> <rules> <rule name="Rule 1" stopProcessing="true"> <match url="app/(.*/.js)" /> <action type="None" /> </rule> <rule name="Rule 2"> <match url="app/(.*)" /> <action type="Rewrite" url="app/index.cshtml" /> </rule> </rules> </rewrite>
I was only trying to exclude js files at the moment, but when I look at the / someurl application, I get an error because one of the js files cannot be loaded. I think because the first rule does not work.
You can help?
source share