Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid custom/Server error in web site?

I have asp.net web application located on server I want to avoid all custom and server error from my site.

For that I have used

<customErrors mode="RemoteOnly" defaultRedirect="~/ErrorPage/TryAgainLater.aspx">   <error redirect="~/ErrorPage/PageNotFound.aspx" statusCode="404"/> </customErrors>

Using above code will able avoid some issue. ie.

Suppose "http://Exaple.com/Careers.aspx" Page available in my site then

Case 1. http://Exaple.com/Careersss.aspx "It was working correct as per above rule".

Case 2. http://Exaple.com/!@##Careersss.aspx "Not working" Note : Here I add special character

Case 3: http://Exaple.com/Careersss.aspxxxx "Not working" Note : add character after ".aspx"

case 4: http://Exaple.com/Careersss.aspx/!@!@!@! "Not works design breaking here". Note : Add '/' with special character.

please help me when user get case 2,3,4 then they automatically redirected to error page.

Thanks In advance.

like image 762
Yashwant Kumar Sahu Avatar asked Mar 02 '12 07:03

Yashwant Kumar Sahu


1 Answers

For above problem we have to change IIS Setting please refer :

http://www.braintrove.com/id/46/page/2#Configure-IIS-for-custom-error-pages

http://blogs.msdn.com/b/webtopics/archive/2008/05/28/iis-7-0-http-error-pages.aspx

like image 89
Yashwant Kumar Sahu Avatar answered Oct 11 '22 21:10

Yashwant Kumar Sahu