I need a simple asp.net routing example
if custom type
http://myweb/mysite.aspx (file does not exist)
I want them to go to
http://myweb/site.aspx (file does exist)
My goal is to make a bilingual site (including url), but without the need to make a physical file
it will be one file
http://myweb/acceuil.aspx
http://myweb/home.aspx
+2
source to share
3 answers
In your web.config add customErrors and node error like this:
<customErrors mode="On" defaultRedirect="ErrorDisplayPage.aspx">
<error statusCode="404" redirect="http://myweb/site.aspx"/>
</customErrors>
This will displayErrorDisplayPage.aspx for all unmanaged errors except 404 errors (which are not displayed on the page). For 404 errors, the browser is redirected to the site.aspx page.
0
source to share