<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Why proper error handling is important</title>
	<link>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/</link>
	<description>If you've read my articles somewhere on the Internet, expect something different here.</description>
	<pubDate>Thu, 02 Sep 2010 11:44:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>

	<item>
		<title>By: g1smd</title>
		<link>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-2352</link>
		<dc:creator>g1smd</dc:creator>
		<pubDate>Sat, 20 Mar 2010 17:53:05 +0000</pubDate>
		<guid>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-2352</guid>
		<description>I asked for a second opinion since you're so set on this.  :)  Here's a summary of the reply I received.

A badly-written (or malicious) script intentionally or otherwise using HTTP/1.0 to send requests received by an IP-based server (i.e. one having a unique IP address which therefore *can* be reached with an HTTP "Host" header) will lead to an infinite redirection loop. Since this violates his own stated preference "to minimize redirects," it seems a no-brainer to support/properly-handle HTTP/1.0 requests by excluding blank hostnames from being redirected.

The same can be said for the uppercase domains: Sure, the *server* is case-insensitive, but do you want to rely on the "kindness of others" not go and create a bunch of mis-cased links to your site? Google and the other majors may sort this in their back-end processing, but what if they drop the ball? What about other search engines, are they that smart, too? I say, delete the [NC] and get on with it.

On the Web, one cannot discount the fact that many access requests come from incompetent and/or malicious scripters. I want my server's function and my page's SERP rankings under *my* control, thank you very much. :)


Please also note that the quotes around ".ht*" in the "&#60;Files “.ht*”&#62;" directive are "smart quotes" or "high-bit-set character-code quotes" and will either crater the server with a HTTP 500 Error, or just not work -- and I haven't got time to test which one right now.

For myself, I'd follow the Apache recommendation here, and use

&#60;FilesMatch "^\.ht"&#62;
Deny from all
&#60;/FilesMatch&#62;

instead. :)

.

That's the problem with .htaccess. It's very compact, very powerful server configuration code. There's often many ways to apparently achieve the same thing, but some might have flaws that have catastrophic consequences for rankings and traffic even though the code 'appears' to work. In addition there are many other ways to try to do some jobs that are totally inappropriate. I look back at code I wrote several years ago, and now change it in several ways using the various things I have learned since then.</description>
		<content:encoded><![CDATA[<p>I asked for a second opinion since you&#8217;re so set on this.  <img src='http://sebastians-pamphlets.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Here&#8217;s a summary of the reply I received.</p>
<p>A badly-written (or malicious) script intentionally or otherwise using HTTP/1.0 to send requests received by an IP-based server (i.e. one having a unique IP address which therefore *can* be reached with an HTTP &#8220;Host&#8221; header) will lead to an infinite redirection loop. Since this violates his own stated preference &#8220;to minimize redirects,&#8221; it seems a no-brainer to support/properly-handle HTTP/1.0 requests by excluding blank hostnames from being redirected.</p>
<p>The same can be said for the uppercase domains: Sure, the *server* is case-insensitive, but do you want to rely on the &#8220;kindness of others&#8221; not go and create a bunch of mis-cased links to your site? Google and the other majors may sort this in their back-end processing, but what if they drop the ball? What about other search engines, are they that smart, too? I say, delete the [NC] and get on with it.</p>
<p>On the Web, one cannot discount the fact that many access requests come from incompetent and/or malicious scripters. I want my server&#8217;s function and my page&#8217;s SERP rankings under *my* control, thank you very much. <img src='http://sebastians-pamphlets.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Please also note that the quotes around &#8220;.ht*&#8221; in the &#8220;&lt;Files “.ht*”&gt;&#8221; directive are &#8220;smart quotes&#8221; or &#8220;high-bit-set character-code quotes&#8221; and will either crater the server with a HTTP 500 Error, or just not work &#8212; and I haven&#8217;t got time to test which one right now.</p>
<p>For myself, I&#8217;d follow the Apache recommendation here, and use</p>
<p>&lt;FilesMatch &#8220;^\.ht&#8221;&gt;<br />
Deny from all<br />
&lt;/FilesMatch&gt;</p>
<p>instead. <img src='http://sebastians-pamphlets.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
.</p>
<p>That&#8217;s the problem with .htaccess. It&#8217;s very compact, very powerful server configuration code. There&#8217;s often many ways to apparently achieve the same thing, but some might have flaws that have catastrophic consequences for rankings and traffic even though the code &#8216;appears&#8217; to work. In addition there are many other ways to try to do some jobs that are totally inappropriate. I look back at code I wrote several years ago, and now change it in several ways using the various things I have learned since then.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian</title>
		<link>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-2350</link>
		<dc:creator>Sebastian</dc:creator>
		<pubDate>Fri, 19 Mar 2010 20:30:33 +0000</pubDate>
		<guid>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-2350</guid>
		<description>Taking the risk of driving you and JdMorgan from WMW as well crazy, we can agree on this?

RewriteCond %{HTTP_HOST} !^(www\.canonical-server-name\.com)?$ [NC]</description>
		<content:encoded><![CDATA[<p>Taking the risk of driving you and JdMorgan from WMW as well crazy, we can agree on this?</p>
<p>RewriteCond %{HTTP_HOST} !^(www\.canonical-server-name\.com)?$ [NC]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: g1smd</title>
		<link>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-2349</link>
		<dc:creator>g1smd</dc:creator>
		<pubDate>Fri, 19 Mar 2010 17:16:55 +0000</pubDate>
		<guid>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-2349</guid>
		<description>No. Your original rule WILL correctly redirect both example.com:80 (port number) and example.com. (trailing period) requests, but it WILL NOT redirect non-canonical www.example.com:80 and www.example.com. requests as originally coded. 

In the interests of fixing all non-canonical incoming links, the proposed replacement does fix ALL of those problems. I prefer to redirect all non-canonical requests (incorrect protocol, sub-domain, domain, TLD, trailing period, port number, or combination of those) to the canonical form. 


As for HTTP/1.0, it is so easy to add support for that, that it seems pointless to not do so. I know that most so-called HTTP/1.0 requests DO include a valid host header, but it only takes one request to arrive without and you potentially have a self-DOS problem on your hands.</description>
		<content:encoded><![CDATA[<p>No. Your original rule WILL correctly redirect both example.com:80 (port number) and example.com. (trailing period) requests, but it WILL NOT redirect non-canonical <a href="http://www.example.com:80">www.example.com:80</a> and <a href="http://www.example.com.">www.example.com.</a> requests as originally coded. </p>
<p>In the interests of fixing all non-canonical incoming links, the proposed replacement does fix ALL of those problems. I prefer to redirect all non-canonical requests (incorrect protocol, sub-domain, domain, TLD, trailing period, port number, or combination of those) to the canonical form. </p>
<p>As for HTTP/1.0, it is so easy to add support for that, that it seems pointless to not do so. I know that most so-called HTTP/1.0 requests DO include a valid host header, but it only takes one request to arrive without and you potentially have a self-DOS problem on your hands.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian</title>
		<link>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-2348</link>
		<dc:creator>Sebastian</dc:creator>
		<pubDate>Fri, 19 Mar 2010 16:46:20 +0000</pubDate>
		<guid>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-2348</guid>
		<description>&lt;p&gt;g1smd, I disagree, and here's why:&lt;/p&gt;

&lt;p&gt;Server names aren't case sensitive. &lt;code&gt;wWw.ExamplE.COM == www.example.com&lt;/code&gt;. Since URIs with just uppercase/lowercase differences in the server name part aren't different at all, there's no point in redirecting for cosmetic reasons. All uppercase server names may look pretty ugly, but technically that's not an issue. Also, avoiding redirects when possible is a good idea.&lt;/p&gt;

&lt;p&gt;I consider requests with a port number faulty, or even abusive, hence I redirect them. That works both for :80 (http) and :443 (https). We don't deal with crappy AOL proxies from the last century any more.&lt;/p&gt;

&lt;p&gt;As for HTTP/1.0 requests, those are rare nowadays, and mostly faked, that is they tell HTTP/1.0 but provide an HTTP/1.1 host header. &lt;b&gt;True HTTP/1.0 requests are dead&lt;/b&gt;, those ancient user agents can't even handle virtual hosts (many domains sharing one IP). So when there's no point for anybody in performing HTTP/1.0 requests at all, why should I still support them?&lt;/p&gt;

&lt;p&gt;Agree?&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>g1smd, I disagree, and here&#8217;s why:</p>
<p>Server names aren&#8217;t case sensitive. <code><a href="http://wWw.ExamplE.COM">wWw.ExamplE.COM</a> == <a href="http://www.example.com">www.example.com</a></code>. Since URIs with just uppercase/lowercase differences in the server name part aren&#8217;t different at all, there&#8217;s no point in redirecting for cosmetic reasons. All uppercase server names may look pretty ugly, but technically that&#8217;s not an issue. Also, avoiding redirects when possible is a good idea.</p>
<p>I consider requests with a port number faulty, or even abusive, hence I redirect them. That works both for :80 (http) and :443 (https). We don&#8217;t deal with crappy AOL proxies from the last century any more.</p>
<p>As for HTTP/1.0 requests, those are rare nowadays, and mostly faked, that is they tell HTTP/1.0 but provide an HTTP/1.1 host header. <b>True HTTP/1.0 requests are dead</b>, those ancient user agents can&#8217;t even handle virtual hosts (many domains sharing one IP). So when there&#8217;s no point for anybody in performing HTTP/1.0 requests at all, why should I still support them?</p>
<p>Agree?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: g1smd</title>
		<link>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-2346</link>
		<dc:creator>g1smd</dc:creator>
		<pubDate>Thu, 18 Mar 2010 20:40:11 +0000</pubDate>
		<guid>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-2346</guid>
		<description>I was surprised to see your "Proper Error Handling" code has several points of failure.

This line in particular:

RewriteCond %{HTTP_HOST} !^www\.canonical-server-name\.com [NC]

It fails to redirect www with port number or trailing period; also fails for wrong casing.

It also crates an infinite loop for HTTP/1.0 requests because host header is blank for HTTP/1.0 requests.

Simple solution, replace [NC] with $, and add ( ) and ?:

RewriteCond %{HTTP_HOST} !^(www\.canonical-server-name\.com)?$</description>
		<content:encoded><![CDATA[<p>I was surprised to see your &#8220;Proper Error Handling&#8221; code has several points of failure.</p>
<p>This line in particular:</p>
<p>RewriteCond %{HTTP_HOST} !^www\.canonical-server-name\.com [NC]</p>
<p>It fails to redirect www with port number or trailing period; also fails for wrong casing.</p>
<p>It also crates an infinite loop for HTTP/1.0 requests because host header is blank for HTTP/1.0 requests.</p>
<p>Simple solution, replace [NC] with $, and add ( ) and ?:</p>
<p>RewriteCond %{HTTP_HOST} !^(www\.canonical-server-name\.com)?$</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#8216;I Robot&#8217; with SebastianX of &#8216;Sebastian&#8217;s Pamphlets&#8217; &#62; Robots.txt Help - Hobo SEO UK</title>
		<link>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-954</link>
		<dc:creator>&#8216;I Robot&#8217; with SebastianX of &#8216;Sebastian&#8217;s Pamphlets&#8217; &#62; Robots.txt Help - Hobo SEO UK</dc:creator>
		<pubDate>Wed, 09 Jan 2008 23:48:15 +0000</pubDate>
		<guid>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-954</guid>
		<description>[...] Why proper error handling is important [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Why proper error handling is important [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Upgrading from IIS/ASP to Apache/PHP</title>
		<link>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-798</link>
		<dc:creator>Upgrading from IIS/ASP to Apache/PHP</dc:creator>
		<pubDate>Tue, 11 Dec 2007 20:47:44 +0000</pubDate>
		<guid>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-798</guid>
		<description>[...] I refuse to discuss IIS error handling. On Apache servers you simply put ErrorDocument directives in your root&#8217;s .htaccess file:  ErrorDocument 401 /get-the-fuck-outta-here.asp ErrorDocument 403 /get-the-fudge-outta-here.asp ErrorDocument 404 /404handler.php ErrorDocument 410 /410-gone-forever.asp ErrorDocument 503 /410-down-for-maintenance.asp # &#8230; Options -Indexes  Then create neat pages for each HTTP response code which explain the error to the visitor and offer alternatives. Of course you can handle all response codes with one single script:  ErrorDocument 401 /error.php?errno=401 ErrorDocument 403 /error.php?errno=403 ErrorDocument 404 /404handler.php ErrorDocument 410 /error.php?errno=410 ErrorDocument 503 /error.php?errno=503 # &#8230; Options -Indexes  Note that relative URLs in pages or scripts called by ErrorDocument directives don&#8217;t work. Don&#8217;t use absolute URLs in ErrorDocument directives itself, because this way you get 302 response codes for 404 errors and crap like that. If you cover the 401 response code with a fully qualified URL, your server will explode. (Ok, it will just hang but that&#8217;s bad enough.) For more information please read my pamphlet Why error handling is important. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] I refuse to discuss IIS error handling. On Apache servers you simply put ErrorDocument directives in your root&#8217;s .htaccess file:  ErrorDocument 401 /get-the-fuck-outta-here.asp ErrorDocument 403 /get-the-fudge-outta-here.asp ErrorDocument 404 /404handler.php ErrorDocument 410 /410-gone-forever.asp ErrorDocument 503 /410-down-for-maintenance.asp # &#8230; Options -Indexes  Then create neat pages for each HTTP response code which explain the error to the visitor and offer alternatives. Of course you can handle all response codes with one single script:  ErrorDocument 401 /error.php?errno=401 ErrorDocument 403 /error.php?errno=403 ErrorDocument 404 /404handler.php ErrorDocument 410 /error.php?errno=410 ErrorDocument 503 /error.php?errno=503 # &#8230; Options -Indexes  Note that relative URLs in pages or scripts called by ErrorDocument directives don&#8217;t work. Don&#8217;t use absolute URLs in ErrorDocument directives itself, because this way you get 302 response codes for 404 errors and crap like that. If you cover the 401 response code with a fully qualified URL, your server will explode. (Ok, it will just hang but that&#8217;s bad enough.) For more information please read my pamphlet Why error handling is important. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Riccardo Giuntoli</title>
		<link>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-715</link>
		<dc:creator>Riccardo Giuntoli</dc:creator>
		<pubDate>Wed, 21 Nov 2007 06:51:48 +0000</pubDate>
		<guid>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-715</guid>
		<description>Thank you for this good guide. 

There's a nice tool to build .htaccess file directly on web with a simple form:

www . htaccesseditor . com /en.shtml [Delinked, the first .htaccess code generation I've tried produces utterly bullshit. If you use the code for www vs. non-www canonicalization from this page you create an exploit enabling negative SEO.]


Best regards, Riccardo Giuntoli.</description>
		<content:encoded><![CDATA[<p>Thank you for this good guide. </p>
<p>There&#8217;s a nice tool to build .htaccess file directly on web with a simple form:</p>
<p>www . htaccesseditor . com /en.shtml [Delinked, the first .htaccess code generation I&#8217;ve tried produces utterly bullshit. If you use the code for www vs. non-www canonicalization from this page you create an exploit enabling negative SEO.]</p>
<p>Best regards, Riccardo Giuntoli.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SEO-sanitizing a WordPress theme in 5 minutes</title>
		<link>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-270</link>
		<dc:creator>SEO-sanitizing a WordPress theme in 5 minutes</dc:creator>
		<pubDate>Fri, 31 Aug 2007 15:25:24 +0000</pubDate>
		<guid>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-270</guid>
		<description>[...] to your theme&#8217;s error page. If you don&#8217;t blog in the root, learn here how you should handle HTTP errors outside the /blog/ directory. Load 404.php in an ASCII editor to check whether it will actually send a 404 response. If the very [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] to your theme&#8217;s error page. If you don&#8217;t blog in the root, learn here how you should handle HTTP errors outside the /blog/ directory. Load 404.php in an ASCII editor to check whether it will actually send a 404 response. If the very [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Google Webmasters Help FAQ &#187; Blog Archive &#187; Error handling and robots.txt (Apache)</title>
		<link>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-235</link>
		<dc:creator>Google Webmasters Help FAQ &#187; Blog Archive &#187; Error handling and robots.txt (Apache)</dc:creator>
		<pubDate>Fri, 24 Aug 2007 09:16:38 +0000</pubDate>
		<guid>http://sebastians-pamphlets.com/why-proper-error-handling-is-important/#comment-235</guid>
		<description>[...] Reprinted with permission [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Reprinted with permission [&#8230;]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
