Pregunta

I want to access web site without Default.aspx. I wrote the code in Application_BeginRequest in global.asax file but it is showing alway Default.aspx when access the web site.

Please provide a solution.

¿Fue útil?

Solución

Issue can be solved by using a Rule in web.config file. It solved my Problem and is working fine in "www.tamisagency.com"

The Rule is as follow:

<system.webServer>
<rewrite>
<rules>
        <rule name="default.aspx Redirect" stopProcessing="true">
        <match url="^(.*\/)*default\.aspx$" />
        <conditions logicalGrouping="MatchAll">
          <add input="{REQUEST_METHOD}" negate="true" pattern="^POST$" />
        </conditions>
        <action type="Redirect" url="{R:1}" redirectType="Permanent"/>
      </rule>
</rules>
</rewrite>
</system.webServer>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top