boogerjones Posted May 8, 2010 Share Posted May 8, 2010 I'm using Apache on Ubuntu to host a local website. I'm using the ErrorDocument directive to forward 404 errors to /cgi-bin/error_404 which is a perl script that looks like this: #!/usr/bin/perl print "Content-type: text/plain\n\n"; $server = $ENV{"SERVER_SOFTWARE"}; print $server; Problem is that in Chrome, it shows up as an error page, even though the HTML source is correct, as you can see in the following screenshots: What really makes me ****ing nuts is that the following works: #!/usr/bin/perl print "Content-type: text/plain\n\n"; foreach $var (sort(keys(%ENV))) { $val = $ENV{$var}; print "${var}=\"${val}\"\n"; } but this, with a single line change, doesn't (it gives the same problem seen in the screenshots): #!/usr/bin/perl print "Content-type: text/plain\n\n"; foreach $var (sort(keys(%ENV))) { $val = $ENV{$var}; print "What the hell?\n"; } What am I doing wrong? This is so goddamn frustrating. There are no errors in the Apache log. It works in Firefox, so maybe this is just a Chrome bug. Link to comment Share on other sites More sharing options...
0 ProChefChad Posted May 10, 2010 Share Posted May 10, 2010 You might want to check that your site is sending the proper HTTP status code (e.g. 404). You could use Fiddler (http://www.fiddler2.com) for this. It will work with Chrome by default (as well as IE). I can't imagine it's a Chrome bug. Perhaps you're just not 100% adhering to the proper standards and Chrome is the only browser that isn't just letting you get away with it. Link to comment Share on other sites More sharing options...
0 Kudos Veteran Posted May 10, 2010 Veteran Share Posted May 10, 2010 Untick "Show suggestions for navigation errors" Link to comment Share on other sites More sharing options...
Question
boogerjones
I'm using Apache on Ubuntu to host a local website. I'm using the ErrorDocument directive to forward 404 errors to /cgi-bin/error_404 which is a perl script that looks like this:
#!/usr/bin/perl print "Content-type: text/plain\n\n"; $server = $ENV{"SERVER_SOFTWARE"}; print $server;Problem is that in Chrome, it shows up as an error page, even though the HTML source is correct, as you can see in the following screenshots:
What really makes me ****ing nuts is that the following works:
#!/usr/bin/perl print "Content-type: text/plain\n\n"; foreach $var (sort(keys(%ENV))) { $val = $ENV{$var}; print "${var}=\"${val}\"\n"; }but this, with a single line change, doesn't (it gives the same problem seen in the screenshots):
#!/usr/bin/perl print "Content-type: text/plain\n\n"; foreach $var (sort(keys(%ENV))) { $val = $ENV{$var}; print "What the hell?\n"; }What am I doing wrong? This is so goddamn frustrating. There are no errors in the Apache log. It works in Firefox, so maybe this is just a Chrome bug.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts