http-status-code-404

404 custom error page redirect doesn't show missing file URL

蹲街弑〆低调 提交于 2019-12-06 15:39:43
I have a custom 404 error page on my site, but while doing other things on the site, the error page makes it hard to figure out what my missing file problems are because it redirects to a given html or php file and takes the URL of the missing file out of the address bar and replaces it with the URL of the custom error page. So for example, when users log in to the site, I have it link to a php file when they hit submit, but then the browsers takes them straight to the 404 error page, so I can't see that the problem is actually a link to one directory higher than it should be. I've tried

htaccess ErrorDocument 404 redirect not working

穿精又带淫゛_ 提交于 2019-12-06 15:27:28
Please tell me why this is not working. It was working but has inexplicably decided to stop working. In php I issue a 404 if the page is not found like so. if(checkPageExists($escaped_url_page_name)){ header('HTTP/1.1: 200 OK'); }else{ header("HTTP/1.0 404 Not Found"); die; } My htaccess is php_flag magic_quotes_gpc Off RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?/$1 [L] ErrorDocument 404 /404.php The 404 page is on the root and is name 404.php. Why would that not work when five minutes ago it was and nothing has

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

眉间皱痕 提交于 2019-12-06 14:52:16
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 file: // Add a Item to the list $scope.addItem = function () { $scope.items.push({ amount: $scope

Customized 404 not found with PHP

◇◆丶佛笑我妖孽 提交于 2019-12-06 14:22:50
I am using the following code to display a cutom 404 not found with PHP: header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); include('404.php'); exit(); However, the default browser's 404 page shows up. What is the right code for producing 404 while including a PHP file? Thanks, Joel Pekka supports GoFundMonica However, the default browser's 404 page shows up. What is the right code for producing 404 while including a PHP file? Some browsers (namely IE and Chrome) show their own 404 page when the size of the page that was output is less than 512 bytes. Pad your output to go

CodeIgniter: Page not found when passing parameters to a controller?

牧云@^-^@ 提交于 2019-12-06 13:41:24
I'm trying to pass parameters to a control in codeigniter, but I'm getting 404 page not found error, I don't get it, I did what the guide says: http://codeigniter.com/user_guide/general/controllers.html#passinguri When I remove the params in the index function and just access the controller everything works fine, but I can't pass a value to it... Here is the code the way I'm trying to send a param: http://mysite/123 <?php class Main extends Controller { function index($username) { echo $username; } } ?> How can I get more info regarding this error from codeigniter? Thank you. With that URL,

Replacing Broken External Images With Custom Image

你说的曾经没有我的故事 提交于 2019-12-06 11:50:03
问题 I'm looping through an array of URL strings of images hosted at an external site. It looks something like this: def get_image_urls image_url_array.each do |image_url| puts image_tag image_url end end Which will return the URLs of images hosted on the external site. The problem is, some of these images might be broken (404). So for example: get_image_urls # These would return image_tags, but for brevity... => "http://someothersite.com/images/1.jpg" "http://someothersite.com/images/2.jpg" "http

Simple Login System using CodeIgniter returning 404 on login

微笑、不失礼 提交于 2019-12-06 09:26:34
I am trying to get my head around PHP and using the CodeIgniter Framework. I have recently been following this tutorial: http://www.codefactorycr.com/login-with-codeigniter-php.html I went through it very methodically and was careful to ensure I made no errors in writing the code. However when I run my project in a browser I get this error after I attempt to submit my login details. Not Found The requested URL /LoginTut/login/VerifyLogin was not found on this server. I ran into a similar problem not to long ago when I was following another tutorial and could not figure it out so abandoned the

Serving static files for development mode in Django

自古美人都是妖i 提交于 2019-12-06 08:31:47
问题 I'm having trouble serving static files in development mode in Django. I do know that this is not a setting that should be used in a production server, so don't worry. For now however I'd like to stick to it. The relevant parts of settings.py are: MEDIA_URL = '/media/' STATIC_URL = '/static/' MEDIA_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__) + '/..'), 'media') STATIC_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__) + '/..'), 'static') And of urls.py :

redirecting to homepage rather than 404 error page!

好久不见. 提交于 2019-12-06 08:22:50
问题 I'm working with PHP. I have an .htaccess file like below, and it redirects to homepage rather than 404 error page :/ what can be the problem here? Appreciate helps! thanks a lot! ErrorDocument 404 /new/err404.html RewriteEngine On RewriteBase /new/ RewriteRule ^login.html$ index.php?s=login&a=loginDo [QSA,L] RewriteRule ^logout.html$ index.php?s=login&a=logoutDo [QSA,L] RewriteRule ^([^/]*).html$ index.php?s=$1 [QSA,L] RewriteRule ^members/([^/]*)$ index.php?s=profile&username=$1 [QSA,L]

Why does PHP built-in web server not serve file called é.txt (on Windows)

一世执手 提交于 2019-12-06 07:28:18
I'm on Windows 7 If I have a directory containing my file é.txt and I start the built-in web server in that directory php -S localhost:8000 then, using my web browser, I request the URL http://localhost:8000/é.txt the web server responds Not Found The requested resource /%C3%A9.txt was not found on this server. Alastair McCormack PHP's Windows filesystem support is broken - it does not properly translate to the native encoding. See How do I use filesystem functions in PHP, using UTF-8 strings? 来源: https://stackoverflow.com/questions/33150112/why-does-php-built-in-web-server-not-serve-file