urlencoded Forward slash is breaking URL

Apache denies all URLs with %2F in the path part, for security reasons: scripts can’t normally (ie. without rewriting) tell the difference between %2F and / due to the PATH_INFO environment variable being automatically URL-decoded (which is stupid, but a long-standing part of the CGI specification so there’s nothing can be done about it). You … Read more

TOMCAT – HTTP Status 404 [duplicate]

Click on Window > Show view > Server or right click on the server in “Servers” view, select “Properties”. In the “General” panel, click on the “Switch Location” button. The “Location: [workspace metadata]” should replace by something else. Open the Overview screen for the server by double clicking it. In the Server locations tab , … Read more

Tomcat 404 error: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists [duplicate]

Problem solved, I’ve not added the index.html. Which is point out in the web.xml Note: a project may have more than one web.xml file. if there are another web.xml in src/main/webapp/WEB-INF Then you might need to add another index (this time index.jsp) to src/main/webapp/WEB-INF/pages/

ASP.NET Custom 404 Returning 200 OK Instead of 404 Not Found

Solution: The problem, it turned out, was the use of the master page. I got it to work by setting the status code later in the pages lifecycle, obviously the rendering of the master page was resetting it, so I overrode the render method and set it after the render was complete. protected override void … Read more

how to fix 404 warnings for images during karma unit testing

That is because you need to configurate karma to load then serve them when requested 😉 In your karma.conf.js file you should already have defined files and/or patterns like : // list of files / patterns to load in the browser files : [ {pattern: ‘app/lib/angular.js’, watched: true, included: true, served: true}, {pattern: ‘app/lib/angular-*.js’, watched: … Read more

What is the proper way to send an HTTP 404 response from an ASP.NET MVC action?

Shooting from the hip (cowboy coding ;-)), I’d suggest something like this: Controller: public class HomeController : Controller { public ActionResult Index() { return new HttpNotFoundResult(“This doesn’t exist”); } } HttpNotFoundResult: using System; using System.Net; using System.Web; using System.Web.Mvc; namespace YourNamespaceHere { /// <summary>An implementation of <see cref=”ActionResult” /> that throws an <see cref=”HttpException” />.</summary> … Read more

HTTP 404 Page Not Found in Web Api hosted in IIS 7.5

I was struggling with this as well. Fortunately, Steve Michelotti documented a solution that worked for me here. At the end of the day, I enabled all verbs (verb=”*”) to the ExtensionlessUrlHandler-Integrated-4.0 handler in my web config. <system.webServer> <validation validateIntegratedModeConfiguration=”false” /> <modules runAllManagedModulesForAllRequests=”true” /> <handlers> <remove name=”ExtensionlessUrlHandler-Integrated-4.0″ /> <add name=”ExtensionlessUrlHandler-Integrated-4.0″ path=”*.” verb=”*” type=”System.Web.Handlers.TransferRequestHandler” resourceType=”Unspecified” requireAccess=”Script” … Read more