-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Http Custom errors no longer work when i18n.LocalizingModule is added to modules #407
Comments
If you have a particular route that you want excluding from being localized by i18n, you can modify the An example of doing that is in the readme. Perhaps try:
|
I tried this but it does not seem to do anything. My custom error pages when I typed them in manually come up fine. {siteurl}/error/notfound/ and actually they are properly translated too which is what I want. But somehow i18n module is intercepting httpErrors configuration and not allowing it to go to /error/notfound/ page but instead is is showing actual 404 iis error. "The resource cannot be found. I would like my custom error page to show up like it normally does when I manually type in {siteurl}/error/notfound/ Any other Idea? How does your custom error pages come up with this module installed? This is MVC 4.72 C# Project. |
I've had custom errors turned off on my current site, but have turned them on and after a bit of playing around with the web.config settings managed to get a custom error page to work for 404s with i18n enabled.
Route definitions:
There's an ErrorController with Index action method that returns the default view (/Views/Error/Index.cshtml). The <system.webserver> setting was got from this blog article: https://benfoster.io/blog/aspnet-mvc-custom-error-pages/ |
Also for clarification I don't have |
Thank you for the feedback, my configuration is not set up exactly like yours but currently we are supporting many web sites with below configuration and all of them are working well with custom error pages. It is similar and my routes are also set up properly since error pages pull up with appropriate response codes. I tried few other things and it is still not working, like I said, as soon as I remove of i18 module it works, I will see if it is something else in the way I am using i18 module. Thank you for your help. `
` |
The i18n.LocalizingModule works wonderfully, however I cannot get my custom error pages to work any longer. I am trying to figure out how to make this work. Anyone have experince? They start working as soon as I remove i18n.LocalizingModule module from web config. Currently my http error section looks like this and works well without i18n.LocalizingModule
<httpErrors errorMode="Custom" existingResponse="Replace"> <!-- Redirect IIS 400 Bad Request responses to the error controllers bad request action. --> <remove statusCode="400" /> <error statusCode="400" responseMode="ExecuteURL" path="/error/badrequest/" /> <!-- Redirect IIS 401 Unauthorized responses to the error controllers unauthorized action. --> <remove statusCode="401" /> <error statusCode="401" responseMode="ExecuteURL" path="/error/unauthorized/" /> <remove statusCode="404" /> <error statusCode="404" responseMode="ExecuteURL" path="/error/notfound/"
and goes on, I did not paste the whole section....
The text was updated successfully, but these errors were encountered: