Reputation: 5458
I am looking for a rewrite URL tag for such conversion
www.example.com/subject.aspx?subject=aa&page=1
to
www.example.com/subjects/aa/1
I tried to add 2 dollars but it showed error in visual studio and it does not let me compile the solution.
Upvotes: 0
Views: 265
Reputation: 4362
Maybe it's because you're using "/" in your rewrite rule so it creates "virtual directories", one way to bypass this is by using html tag base href.
Upvotes: 0
Reputation: 5134
Try this:
<rewrite url="^~/subjects/([A-Za-z]+)/([0-9]+)$" to="~/subject.aspx?subject=$1&page=$2"/>
Upvotes: 3