asp.net - Remove ASPX FILE Extention in Web.config But Negate Rewrite if URL Contains Period -
all right, of use standard rule below remove aspx extention in urls. <rule name="remove"> <!--removes .aspx extension pages.--> <match url="(.*)" /> <conditions logicalgrouping="matchall"> <add input="{request_filename}" matchtype="isfile" negate="true" /> <add input="{request_filename}" matchtype="isdirectory" negate="true" /> </conditions> <action type="rewrite" url="{r:1}.aspx" /> </rule> however modify rule prevent write rule catching url period in it. that way if tries type in http://www.domain.com/picture.jpg rule doesn't catch it. luckily isfile , isdirectory conditions prevent actual files being hit rule whenever have case types in file doesn't exist on server rule catches , asp.net this: http://www.domain.com/404error.aspx?aspxerrorpath=/pictur...