I have Created a WEBSITE in Asp.net C#, SQL-Server 2005.
My Requirement is I don't want to Display the Extension .aspx in browser.
For Example, I have Products.aspx page from these I want to display the products in browser.
Please help me.
I have Created a WEBSITE in Asp.net C#, SQL-Server 2005.
My Requirement is I don't want to Display the Extension .aspx in browser.
For Example, I have Products.aspx page from these I want to display the products in browser.
Please help me.
Change your webconfig
file like this:
<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Product.aspx Redirect" stopProcessing="true">
<match url="^(.*\/)*Product\.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>
</configuration>
Try these it will help you..
<configuration>
<system.webserver>
<rewrite>
<rules>
<rule name="extensionless" stopprocessing="true">
<match url="(.*)\.html$" />
<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}.html" />
</rule>
</rules>
</rewrite>
</system.webserver>
</configuration>