Vikash21 says:
Hi,
Does anyone here has a guide or has a sample project on URL shortner.I am also looking for guidance on URL Rewritting.
Thanks in advance
Hi Vikash21,
Add the below code in your web.config inside <system.webServer /> to hide the .aspx extension.
<rewrite>
<rules>
<rule name="extensionless" stopProcessing="true">
<match url="(.*)\.aspx"/>
<action type="Redirect" url="{R:1}" redirectType="Permanent"/>
</rule>
<rule name="removeextension" enabled="true">
<match url=".*" negate="false"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
<add input="{URL}" pattern="(.*)\.(.*)" negate="true"/>
</conditions>
<action type="Rewrite" url="{R:0}.aspx"/>
</rule>
</rules>
</rewrite>