Tag Info

New answers tagged

0

Request headers can cause the size of responses to vary. For example if the requesting device or browser allows for Gzip encoding they will let your webserver know that they want the content in gzip format which is a lot smaller. Also pages which are dynamically generated can vary in size. In your example you have /api/. Unless if your api is pumping out ...


0

If you're using Firebug with Page Speed (generally helpful for web developers) then you can look in the Resources tab. This will show you the HTTP header returned for every resource on a page, including the page itself. This also helps identify redirects on the way to a 404 page if things on your site aren't coded/configured properly.


1

As noted above, you could check with cURL if you're interested in building your own 404 checker. An example with PHP: $resourceUrl = 'http://example.com/test.html'; $ch = curl_init($resourceUrl); curl_setopt($ch, CURLOPT_NOBODY, true); curl_exec($ch); $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if($statusCode == '404'){ ...


3

HTTP status codes are sent on the HTTP level (e.g., when requesting resources), so you can’t find them in the HTML. The server decides which status to send when you request a page, so the very same page could send 404 and ten seconds later 200. Various tools can be used to display the received HTTP status codes. You could use your browser, which most ...


1

If you have firebug you can see the difference, they actually return the 404 header. A website is perfectly capable of returning content with a 404-header: header("HTTP/1.0 404 Not Found"); echo file_get_contents('page-not-found.html'); So: How to check for the statuscode: See answer 1 for a cURL solution, answer 2 for a get_headers() solution, or use ...



Top 50 recent answers are included