Using the IIS URL Rewrite Module I am trying rewrite an incoming Url from /en/page.aspx to /en/page/index.aspx
Using regular expression I am checking that the string ends with .aspx
^.*(.aspx)$
Currently in capture group I am getting
/en/page.aspx
How can i only capture /en/page part?
Further down the line I will rewrite the Url as follows:
{R:0}/index.aspx
To match without capturing you can use the
?:pattern, like(?:\.aspx). However, to suit your redirection needs you may want to use the following expression:So that
{R:1}will point to exactly what you need. Also note you need to escape the dot, so that the expression will match the dot character and not every other one.