2
Good afternoon, I developed a system and I have a logic that does not allow unauthorized profiles to access parts of the system that is not allowed for it. What happens is that when trying to access an area that is not allowed, IIS gives a 404(Not Found) error page in response to frustrated attempt. What I wanted to know is: Is there any way I can put a custom error page on IIS, so that when this happens, it shows my custom error page ? 'Cause I get scared about the security of my application.
If anyone can help, I’d be grateful !
Is using MVC?
– f.fujihara
Exactly, MVC even.
– Érik Thiago
In my application I have customized a class to do this kind of redirect. I created a class by inheriting the Defaultcontrollerfactory class, then overriding this method: Getcontrollerinstance
– f.fujihara
It’s because my problem is, I even have a library that when you try to access a page that doesn’t exist, redirects it to a custom page. There is a detail: Without publishing in IIS, running by VS even, when I try to access an area not allowed by a profile that has no access, it redirects to the login page again, that is, logout. But not on IIS, it gives the page 404. And I didn’t want that, I wanted a page like I did, but on IIS.
– Érik Thiago