Remove home page name from Url in ASP.Net

on Oct 28, 2021 04:03 AM

i want to display website name in the url bar as well as my website name like  

when user navigate to main home page then the website name should be display into url bar.

urlRouting.MapPageRoute("", "Home", "~/Home.aspx");

i have used as above to navigate on home page.

Download FREE API for Word, Excel and PDF in ASP.Net: Download
on Oct 28, 2021 04:06 AM

Hi Bhavesh23,

Change your webconfig with below code:

<?xml version="1.0"?>
                <rule name="default.aspx Redirect" stopProcessing="true">
                    <match url="^(.*\/)*home\.aspx$" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_METHOD}" negate="true" pattern="^POST$" />
                    <action type="Redirect" url="{R:1}" redirectType="Permanent"/>