Thursday, 14 May 2015

how to Remove .aspx from url in asp.net

FIRST ADD WEB.CONFIGRATION file in your website


<system.webServer>
  <rewrite>
    <rules>
      <rule name="RewriteASPX">
        <match url="(.*)" />
        <conditions logicalGrouping="MatchAll">
          <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
        </conditions>
        <action type="Rewriteurl="{R:1}.aspx" />
      </rule>
    </rules>
  </rewrite>
</system.webServer> 

And NOW PUT THIS page name in the link as it is for Example see this:-


<a href="Index">Sign in</a> 1.Use this


How to Remove the .aspx from ASP.NET URL'S and How to Cut the URL's in Short Form

0 comments: