visual studio 2013 http error 404, url rewritten - asp.net

my solution has been working fine up until today, and most of it still works except for a single page, which is a default.aspx page. I get a "HTTP Error 404.0 - Not Found".
The URL has been rewritten from '~/Staff/Default.aspx', to '~/Staff/Default', and I have no idea why. If I retype in the '.aspx' on the end, it still gets taken off.
Detailed Error information:
Module: IIS Web Core,
Notification: MapRequestHandler ,
Handler: StaticFile,
Error Code: 0x80070002,
Requested URL: http://localhost:50742/Staff/Default,
Physical Path: C:\Users\Me\Documents\Visual Studio 2013\Projects\etc\etc\Staff\Default,
Logon Method: Negotiate
Other pages work, e.g. '~/Booking/Default.aspx' works fine, as do other similar directories with default pages in, but not this one. I don't have routing or any rewrites set up, and yesterday I had it working.
Any ideas?
thanks

Related

Custom Page 404 isn't shown on server (asp .net framework 4.8)

On our websites as someone visits a non-existing page, we dinamically create a 404 error page that returns a status code 404.
It works perfectly on localhost, but on the server the same page returns the standard 404 IIS (7.0) error
(IISError) instead of the custom one CustomError.
We can't edit the web.config file because we don't have a physical page to redirect to.
Is it possible that there is a IIS configuration that prevents our custom error page from showing?
There is a configuration setting in IIS. Click your application in IIS, and find Error pages settings.
For the error code, you could specify location of your custom page.

IIS 8.5 Custom Error Page failed to redirect

I configured the 404 error to redirect(302) client to a page instead of returning 404 error.
It is working, but I found once the reqest URL contains '%20' in URL, then the redirect will not function. IIS will return 404 to client.
I've also tried adding the same redirect setting into the ".NET Error Page" with no luck. Still failed and showed the 404 page.
Anyone has solution?
Win2012R2, IIS8.5, Microsoft .NET Framework :4.0.30319; ASP.NET :4.0.30319.34209, MVC4

How do I get a friendly error page to replace the asp.net error page for url "WEB-INF./web.xml"?

This url is part of a pci compliance scan and it is flagging the very sparse asp.net error page returned, which on the live site is a 500 status code and the text
Server Error in '/' Application.
Runtime Error
Description: An exception occurred while processing your request.
Additionally, another exception occurred while executing the custom
error page for the first exception. The request has been terminated.
When running the site in visual studio I however get a 404 and the text
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its
dependencies) could have been removed, had its name changed, or is
temporarily unavailable. Please review the following URL and make
sure that it is spelled correctly.
Requested URL: /WEB-INF./web.xml
Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.0.30319.18044
I've tried ignoring that url in routing and mapping it to our 404 route /error/not-found, we have custom errors on with a default redirect to /error/internal. I also tried using a location tag to deny access, blocking it with request filtering, and using a handler with that path to catch the request.
I tried this rewrite, also tried the same rule blocking and redirecting but I still get the same asp.net error page. The image cut off but the rule is ^.*\./.*$ and it does match the url I am trying to filter (I've also tried simply WEB-INF).
Any idea how I can get this url to show our custom error page?
Adding relaxedUrlToFileSystemMapping="true" to the httpRuntime node in the web.config allowed this url to get processed by ASP.Net MVC as expected.
<system.web>
<httpRuntime relaxedUrlToFileSystemMapping="true" />
</system.web>
You could use Managed Fusion's rewriter library located here, it works similarly to redirecting through Apache configuration: http://managedfusion.com/products/url-rewriter/
The documentation for how to use it is here: http://managedfusion.com/products/url-rewriter/documentation.aspx

IIS6 - Why won't my Custom error page display?

I have a custom error page that should display for HTTP 404 errors. It does not and I am having difficulty figuring out why.
My web.config is set
<customErrors mode="On" />
Fiddler shows a 401.2, followed by a 404 for a single POST. Both errors should be custom. The 401.2 is working because I see it in fiddler. The 404 happens immediately after so all I see in the browser is the generic 404 error. I should see my custom 404 page.
Why won't my custom HTTP 404 page showup?
What's the URL you are testing with? If it's not a file type handled by ASP.NET (e.g. /foo/bar.txt) then you won't see the ASP.NET defined 404 handler.
-Oisin
If you're looking for what the 404.x codes mean here's this
HTTP 404.x-File or Directory Not Found
None - File or directory not found.
1 - Web site not accessible on the requested port.
2 - Web service extension lockdown policy prevents this request.
3 - MIME map policy prevents this request.
Seems to be an IIS specific code, not sure if IIS sends these details with the response

iis 7 /asp.net doesn't obey error pages settings on .net4 web site

I've just noticed in my logs that if there is a "." at the end of the url that doesn't exist on a .net 4 integrated apppool, iis 7.5 does not display your preset 404 url but default not found page.
I have my custom 404 url on both iis and asp.net settings. it works just fine with any other url that doesn't exist.
Site uses .net 4 routing with asp.net webforms. As far as i know it is nothing to do with routing beacuse even if i try a random url like "site.com/djfdhfhgfhgfggfff." behavior doesn't change.
Anyone experienced something like this?
Eror looks like coming from asp.net. it reads
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /etc.
update: just done a trace logging and looks like global.asax throwing it.
MODULE_SET_RESPONSE_ERROR_STATUS
ModuleName global.asax
Notification 1
HttpStatus 404
HttpReason Not Found
HttpSubStatus 0
ErrorCode 0
ConfigExceptionInfo
Notification BEGIN_REQUEST
ErrorCode The operation completed successfully. (0x0)
Basically your are getting a 404 code from ASP.NET instead of IIS. A simple fix would be to tell asp.net to use your custom page for 404 errors through the section in your web.config. See the example in this link ... http://msdn.microsoft.com/en-us/library/h0hfz6fc.aspx

Resources