http-status-code-404

ASP.net web.config doesn't catch all 404's

痞子三分冷 提交于 2019-12-08 07:42:49
问题 In my web.config I have: <customErrors mode="On" defaultRedirect="~/Error.aspx" redirectMode="ResponseRewrite"> <error statusCode="500" redirect="~/Error.aspx" /> <error statusCode="404" redirect="~/404.aspx" /> </customErrors> Yet with these URL's, only the 2nd one with file extension defined works, the other one returns the blue screen 404 "Server Error in Application". http://127.0.0.1/scirranew/invalidpath http://127.0.0.1/scirranew/invalidpath.aspx Any ideas? I'm on ASP.net 4, IIS 7.5.

PHP: Can't change 404 status code, but there is no error from header()

妖精的绣舞 提交于 2019-12-08 07:42:49
问题 I'm processing unavaliable pages in my custom PHP website. To do this I created a .htaccess file with this single line: ErrorDocument 404 /index.php At the beginning of index.php I placed this code: header($_SERVER['SERVER_PROTOCOL'].' 200 OK', true, 200); This works perfect in my WAMP environment. I'm checking http headers, and it throws: Status=OK - 200 But in my Linux hosting I always get: Status=Not Found - 404 And the weird part is that PHP isn't throwing any error at all... it's like

CodeIgniter - get error messages

∥☆過路亽.° 提交于 2019-12-08 07:38:32
I created my own custom error page by changing the line in config.php $route['404_override'] = 'main/_404'; So now it loads the correct page, by loading the _404 function in my controller The issue is, I still want to be able to get a hold of the $heading & $message error variables displayed in the default page, which show up as: <div id="container"> <h1><?php echo $heading; ?></h1> <?php echo $message; ?> </div> Here's my _404 function if anyone can give me some advice how to add those variables I would greatly appreciate it public function _404() { $data['query'] = array('title' => 'Page not

CodeIgniter - get error messages

送分小仙女□ 提交于 2019-12-08 07:18:59
问题 I created my own custom error page by changing the line in config.php $route['404_override'] = 'main/_404'; So now it loads the correct page, by loading the _404 function in my controller The issue is, I still want to be able to get a hold of the $heading & $message error variables displayed in the default page, which show up as: <div id="container"> <h1><?php echo $heading; ?></h1> <?php echo $message; ?> </div> Here's my _404 function if anyone can give me some advice how to add those

asp.net SEO friendly 404 set redirectMode in code

本小妞迷上赌 提交于 2019-12-08 06:53:02
问题 I am trying to achive the below configuration through code <customErrors defaultRedirect="GenericError.htm" mode="On" redirectMode="ResponseRewrite"> <error statusCode="404" redirect="404.aspx"/> </customErrors> SEO - Handle 404 errors if ((ex is HttpException && 404 == ((HttpException)ex).GetHttpCode())) { HttpContext.Current.RewritePath("~/404.aspx"); //Response.Redirect("~/404.aspx"); //Server.Transfer("~/404.aspx"); //Error executing child request for } Question: How can I set

Automated URL checking from a MySQL table

拈花ヽ惹草 提交于 2019-12-08 05:43:56
问题 Okay, I have a list of URLs in a MySQL table. I want the script to automatically check each link in the table for 404, and afterward I want it to store whether the URL was 404'd or not, as well as store a time for last checked. Is this even possible to do automatically, even if no one runs the script? ie, no one visits the page for a few days, but even with no one visiting the page, it automatically ran the test. If its possible, how could I go about making a button to do this? 回答1: No need

Spring MVC - No mapping found for HTTP request with URI [duplicate]

非 Y 不嫁゛ 提交于 2019-12-08 04:09:28
问题 This question already has answers here : Why does Spring MVC respond with a 404 and report “No mapping found for HTTP request with URI […] in DispatcherServlet”? (7 answers) Closed 2 years ago . I'm aware that there are loads of questions on the topic but none of the solutions i found here worked for me. I'm using Spring with Jetty 6 so i don't have a web.xml file. The mapping for the spring dispatcher servlet is set to "/" in jetty's config dispatcher: <bean class="org.mortbay.jetty.servlet

Including Autofac.Module in custom module breaks Orchard

空扰寡人 提交于 2019-12-08 03:52:40
问题 See here & here for why I'm trying to do this. I have a custom module that I'm building (and which is it's own .csproj in the Orchard .sln, as normal) I have a (relatively complex) dependency that I wish to inject into Orchard. Currently if I build and run the code it's perfectly happy until it hits my dependency at which point it null-refs (as I'd expect it to). I can access the admin site and any pages that don't reference the dependency. I add a reference to Autofac to my project. -> All

How do I write a JSON object to file via Node server?

自作多情 提交于 2019-12-08 03:25:42
问题 I am using Angular for the front-end and attempting to write a JSON object to a file called 'post.json' in the same directory as index.html. I can make it work using PHP but I want to know how do it with Node.js. I have looked at a lot of posts online but maybe I am not understanding how http POST actually works and what settings the server needs to write to file from an Angular app. How do I write to file from the Angular app and what settings does the node server need? Code in the Angular

PowerPivot can't connect to OData WebAPI

白昼怎懂夜的黑 提交于 2019-12-08 03:12:21
问题 When I try to connect to my localhosted Odata WebAPI from Excel 2010 PowerPivot I got 404: Not found error. Actually, PowerPivot can explore the list of my endpoints and says that connection successful. But when I press Finish button it shows 404. Strange, but Fiddler captures nothing! Please suggest. Thank you! 来源: https://stackoverflow.com/questions/21677331/powerpivot-cant-connect-to-odata-webapi