i have several sites that are showing a 500 internal server error when the url contains either a space or %20 as a directory after the domain. ie. http://domain.com/%20/ or "http://domain.com/ /".
Has anyone run into this, and/or know how to fix it? I have created a new project and adjusted the error handling in the web.config, but am unable to direct this specific error to a general error page.
I get this too, but I don't have any links to /%20/ so it's not a problem. I'd look in to why you're getting links like this. If you can't get rid of them, then try a UrlRewrite to rewrite the url correctly.
We don't have any links to this URL, it's more an issue of displaying a server error, and I am unable to properly catch and handle the error to display my error page.
There is little risk, but it is a information disclosure security issue as this error displays information regarding the type of server the website is hosting.
I have tried to use UrlRewrite, but the error doesn't seem to get far enough through the pipeline to be able to be rewritten.
2) At an IIS level on your site you can set .Net Error Pages. These can be configured as a last resort, i.e. nothing else has caught them and you want to hide information about your server.
After continuing to try URL Rewriting, I kept receiving errors regarding the "The configSource file ... is also used in a parent" error. I have moved all the settings into the web.config, which now allows the proper handling of what should be a 404 error.
Maybe this is a bug in IIS in regards to how it handles the configsource attribute.
Whitespace in URL Causes Server Error
i have several sites that are showing a 500 internal server error when the url contains either a space or %20 as a directory after the domain. ie. http://domain.com/%20/ or "http://domain.com/ /".
Has anyone run into this, and/or know how to fix it? I have created a new project and adjusted the error handling in the web.config, but am unable to direct this specific error to a general error page.
thank you in advance for any help.
I get this too, but I don't have any links to /%20/ so it's not a problem. I'd look in to why you're getting links like this. If you can't get rid of them, then try a UrlRewrite to rewrite the url correctly.
We don't have any links to this URL, it's more an issue of displaying a server error, and I am unable to properly catch and handle the error to display my error page.
There is little risk, but it is a information disclosure security issue as this error displays information regarding the type of server the website is hosting.
I have tried to use UrlRewrite, but the error doesn't seem to get far enough through the pipeline to be able to be rewritten.
Hi Jay,
To catch server level errors (i.e 500), there are a couple of options (others might have alternatives as well).
1) Check out this blog here: http://benfoster.io/blog/aspnet-mvc-custom-error-pages
2) At an IIS level on your site you can set .Net Error Pages. These can be configured as a last resort, i.e. nothing else has caught them and you want to hide information about your server.
Thanks,
Nik
Thanks Nik. I will look into your suggestions.
After continuing to try URL Rewriting, I kept receiving errors regarding the "The configSource file ... is also used in a parent" error. I have moved all the settings into the web.config, which now allows the proper handling of what should be a 404 error.
Maybe this is a bug in IIS in regards to how it handles the configsource attribute.
is working on a reply...