http-status-code-404

redirect 404 to similar urls

大憨熊 提交于 2019-12-03 01:41:21
问题 I have a website with stories in it. I can have multiple types of stories within multiple categories like: children romance scifi action thriler quests The stories are accessible using urls like: www.example.com/action/story-name-action/ www.example.com/romance/story-name-romance/ and the first param (action) and the second (story-name-action) are redirected with .htaccess using rules. This part works just fine. Lately, I get few dozen of 404 from different sites and here's what I want to do

Mercurial: Why do I get a 404 error when pushing to a repository whose URL I can hit in a browser?

我的未来我决定 提交于 2019-12-03 01:33:19
I have a Mercurial repository that I can see just fine if I navigate to it in a browser, but when I try to do a push, with my default path set to the same URL that I visit in the browser, I get this: abort: HTTP Error 404: Not Found Should the URL that I push to be different in some way? Is this similar to this configuration , where hgweb.config need to be configured properly: / = /home/my_username/hg/** (with the two stars at then end) Or is it a http vs. https issue ? For https, you need a correct .hgrc file , otherwise you can also get the 404 error. See the .hg/hgrc file man page . [ui]

How to solve a “HTTP Error 404.3 - Not Found” error?

主宰稳场 提交于 2019-12-03 01:32:01
Simple problem. I start up VS2008 and create a new WCF Service application. This will create a default application with a few test methods showing it works. I press CTRL+F5 and it does indeed work! Great! However, it uses the Visual Studio Development server, which I don't want to support. So I go to the project properties, switch to using a local IIS Web server, create the virtual directory and press CTRL+F5 again. And this "HTTP Error 404.3 - Not Found" error is greeting me back. So something in my IIS7/Vista-64 setup is wrong. What could I be missing? Click Start -> Run cmd and type: cd "

Suppressing 404s in retina.js library

跟風遠走 提交于 2019-12-02 22:05:23
We use the js lib retina.js which swaps low quality images with "retina" images (size times 2). The problem is, that retina.js throws a 404 for every "retina" image which can't be found. We own a site where users can upload their own pictures which are most likely not in a retina resolution. Is there no way to prevent the js from throwing 404s? If you don't know the lib. Here is the code throwing the 404: http = new XMLHttpRequest; http.open('HEAD', this.at_2x_path); http.onreadystatechange = function() { if (http.readyState != 4) { return callback(false); } if (http.status >= 200 && http

How can I get NSURLResponse body?

試著忘記壹切 提交于 2019-12-02 21:54:30
I'm writing an application that connect with a server using NSURLConnection . In the delegate method didreceiveresponse , if the status code is 404, I cancel the connection and I would like to show a message with a custom error that is generated in the server. The problem is that from response object, I only can get statuscode, headers, mimetype, etc. but no body. How do I get the body message from NSURLResponse ? Why do you cancel the connection? After all, 404 can have content body as well. Just don't cancel it, and let the program call the next delegate NSURLConnection method. When the data

.htaccess redirect to 404 page RewriteRule

末鹿安然 提交于 2019-12-02 20:19:25
Is there a way to enter a RewriteRule in the htaccess file to redirect to a 404 page if a certain folder/url path as been typed or reached? For example, if I want every user to be redirected to a 404 page if they get to: www.mydomain.com/abc or www.mydomain.com/abc/ or whatever that comes after "abc", even if that folder really exists, I do not want the users to be able to reach it. If they do reach it, I want them to see the 404 error page. * Please note I am not looking to set up a custom 404 error page, I am looking for a way to redirect to the default 404 page. How can I do it? Is it

Nginx rewrite in subfolder (404)

我是研究僧i 提交于 2019-12-02 19:19:45
I has a site host on a NGINX server which used to work fine to remove index.php in nginx site config using try_files . But now I am going to add a blog on it, where the URL will be www.foo.com/blog , I can access the blog and use index.php?p= . But, once I use pretty permalink with Nginx Helper, www.foo.com/blog/2013/07/bar , I get 404 . server { # don't forget to tell on which port this server listens listen 80; # listen on the www host server_name foo.com; # and redirect to the non-www host (declared below) return 301 $scheme://www.ultra-case.com$request_uri; } server { # listen 80 default

How to return 404 response status in Spring Boot @ResponseBody - method return type is Response?

£可爱£侵袭症+ 提交于 2019-12-02 18:57:46
I'm using Spring Boot with @ResponseBody based approach like the following: @RequestMapping(value = VIDEO_DATA_PATH, method = RequestMethod.GET) public @ResponseBody Response getData(@PathVariable(ID_PARAMETER) long id, HttpServletResponse res) { Video video = null; Response response = null; video = videos.get(id - 1); if (video == null) { // TODO how to return 404 status } serveSomeVideo(video, res); VideoSvcApi client = new RestAdapter.Builder() .setEndpoint("http://localhost:8080").build().create(VideoSvcApi.class); response = client.getData(video.getId()); return response; } public void

Ionic + Angular - How to avoid the “404 Not Found (from cache)” after POST request?

孤街醉人 提交于 2019-12-02 18:57:20
this question is partly pointing to my previous question : Ionic + Angular POST request return state 404 But i wasn't able to find working solution. Problem is following: if I do request from the mobile app running on the device i always get response 404: Request Method:POST Status Code:404 Not Found (from cache) Request Headersview source Accept:application/json, text/plain, */* Content-Type:text/plain Origin:file:// User-Agent:Mozilla/5.0 (Linux; Android 4.4.2; Lenovo Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36 Request Payloadview

Zend Framework: How to intentionally throw a 404 error?

强颜欢笑 提交于 2019-12-02 18:56:54
I would like to intentionally cause a 404 error within one of the controllers in my Zend Framework application. How can I do this? A redirect to a 404 would be: throw new Zend_Controller_Action_Exception('Your message here', 404); Or without Exception: $this->_response->clearBody(); $this->_response->clearHeaders(); $this->_response->setHttpResponseCode(404); You can always set the response code manually, without throwing any exceptions. $this->_response->clearBody(); $this->_response->clearHeaders(); $this->_response->setHttpResponseCode(404); 来源: https://stackoverflow.com/questions/4188923