Q:

Rewrite URL in ASP.NET

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.

A:

Try this:
<rewrite url="^~/subjects/([A-Za-z]+)/([0-9]+)$" to="~/subject.aspx?subject=$1&amp;page=$2"/>

