<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" > <channel><title>Comments on: A Better 404</title> <atom:link href="http://blog.urbanmainframe.com/2008/11/a-better-404/feed/" rel="self" type="application/rss+xml" /><link>http://blog.urbanmainframe.com/2008/11/a-better-404/</link> <description>an oasis for idle minds</description> <lastBuildDate>Thu, 11 Mar 2010 16:57:54 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: James John Malcolm</title><link>http://blog.urbanmainframe.com/2008/11/a-better-404/#comment-143</link> <dc:creator>James John Malcolm</dc:creator> <pubDate>Thu, 01 Jan 2009 18:36:04 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=760#comment-143</guid> <description>(Fix: I left an error in my code here, the correct code can be found here: http://james.gameover.com/index.php/2009/improve-your-wordpress-the-404-error-page/ )Also, it&#039;s nice to cut the http-referer-as-link-text up in chunks like so: chunk_split($_SERVER[&#039;HTTP_REFERER&#039;], 25). This makes lines wrap properly.</description> <content:encoded><![CDATA[<p>(Fix: I left an error in my code here, the correct code can be found here: <a href="http://james.gameover.com/index.php/2009/improve-your-wordpress-the-404-error-page/">http://james.gameover.com/index.php/2009/improve-your-wordpress-the-404-error-page/</a> )</p><p>Also, it’s nice to cut the http-referer-as-link-text up in chunks like so: chunk_split($_SERVER[’HTTP_REFERER’], 25). This makes lines wrap properly.</p> ]]></content:encoded> </item> <item><title>By: James John Malcolm</title><link>http://blog.urbanmainframe.com/2008/11/a-better-404/#comment-142</link> <dc:creator>James John Malcolm</dc:creator> <pubDate>Thu, 01 Jan 2009 17:28:05 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=760#comment-142</guid> <description>Happy New Year!I&#039;ll link to you then for that magic, saves me typing!</description> <content:encoded><![CDATA[<p>Happy New Year!</p><p>I’ll link to you then for that magic, saves me typing!</p> ]]></content:encoded> </item> <item><title>By: DarkBlue</title><link>http://blog.urbanmainframe.com/2008/11/a-better-404/#comment-141</link> <dc:creator>DarkBlue</dc:creator> <pubDate>Thu, 01 Jan 2009 16:58:18 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=760#comment-141</guid> <description>Thanks for that James. I will revisit this soon with a new article that includes all the 404 code that I&#039;m currently using. I also feel a possible mod_rewrite article coming on - there&#039;s a few custom rewrites on this site to handle the edge cases and to deal with some of the URIs from the old website which still get a lot of traffic.Thanks again for everything you&#039;ve contributed to this thread. I appreciate your feedback.Happy New Year!!! :-)</description> <content:encoded><![CDATA[<p>Thanks for that James. I will revisit this soon with a new article that includes all the 404 code that I’m currently using. I also feel a possible mod_rewrite article coming on - there’s a few custom rewrites on this site to handle the edge cases and to deal with some of the URIs from the old website which still get a lot of traffic.</p><p>Thanks again for everything you’ve contributed to this thread. I appreciate your feedback.</p><p>Happy New Year!!! <img src='http://blog.urbanmainframe.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: James John Malcolm</title><link>http://blog.urbanmainframe.com/2008/11/a-better-404/#comment-140</link> <dc:creator>James John Malcolm</dc:creator> <pubDate>Thu, 01 Jan 2009 16:50:37 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=760#comment-140</guid> <description>I must apologise, I hadn&#039;t actually taken the time to look at your 404 page itself! It does indeed do everything it should, and I was wondering if you would consider sharing your code which breaks down the URI for the search engine. Me, and I&#039;m sure other readers too, would be very grateful.Second try at the code: ----------- (?php // When there is a refer if ($_SERVER[&#039;HTTP_REFERER&#039;]) { ?) (p)The link at (em)(a href=\&quot;&quot; . $_SERVER[&#039;HTTP_REFERER&#039;] . &quot;\&quot;)&quot; . $_SERVER[&#039;HTTP_REFERER&#039;] . &quot;(/a)(/em) is incorrect or (em)&quot; . $_SERVER[&#039;REQUEST_URI&#039;] . &quot;(/em) has been moved, renamed or deleted.(/p) (?php } // When there&#039;s no refer else { echo &quot;(p)(em)&quot; . $_SERVER[&#039;REQUEST_URI&#039;]; ?) (/em) has been moved, renamed or deleted.(/p) (?php } ?) --------- All tags changed to have (&#039;s and )&#039;s...for posting-comment-purposes. I also seperated the html from the php as much as made sense (supposed to be better and not kill kittens or something - it made sense when the dev people told me).I suppose you have something like this on your page, instead of the code you have in the article.Other things which are sometimes needed are a: --- # Customized error messages. ErrorDocument 404 /index.php?error=404 --- In your .htaccessAnd a proper http-status message in your 404.php in your wordpress theme folder: -- (?php ob_start(); ?) (?php header(&quot;HTTP/1.1 404 Not Found&quot;); ?) --Hope that works!</description> <content:encoded><![CDATA[<p>I must apologise, I hadn’t actually taken the time to look at your 404 page itself! It does indeed do everything it should, and I was wondering if you would consider sharing your code which breaks down the <acronym title="Uniform Resource Identifier">URI</acronym> for the search engine. Me, and I’m sure other readers too, would be very grateful.</p><p>Second try at the code:<br /> -----------<br /> (?php<br /> // When there is a refer<br /> if ($_SERVER[’HTTP_REFERER’]) { ?)<br /> ℗The link at (em)(a href=\”” . $_SERVER[’HTTP_REFERER’] . “\”)” . $_SERVER[’HTTP_REFERER’] . “(/a)(/em) is incorrect or (em)” . $_SERVER[’REQUEST_URI’] . “(/em) has been moved, renamed or deleted.(/p)<br /> (?php }<br /> // When there’s no refer<br /> else {<br /> echo “℗(em)” . $_SERVER[’REQUEST_URI’];<br /> ?)<br /> (/em) has been moved, renamed or deleted.(/p)<br /> (?php } ?)<br /> ---------<br /> All tags changed to have (‘s and )‘s…for posting-comment-purposes. I also seperated the html from the php as much as made sense (supposed to be better and not kill kittens or something - it made sense when the dev people told me).</p><p>I suppose you have something like this on your page, instead of the code you have in the article.</p><p>Other things which are sometimes needed are a:<br /> ---<br /> # Customized error messages.<br /> ErrorDocument 404 /index.php?error=404<br /> ---<br /> In your .htaccess</p><p>And a proper http-status message in your 404.php in your wordpress theme folder:<br /> --<br /> (?php ob_start(); ?)<br /> (?php header(“<acronym title="HyperText Transfer Protocol">HTTP</acronym>/1.1 404 Not Found”); ?)<br /> --</p><p>Hope that works!</p> ]]></content:encoded> </item> <item><title>By: DarkBlue</title><link>http://blog.urbanmainframe.com/2008/11/a-better-404/#comment-128</link> <dc:creator>DarkBlue</dc:creator> <pubDate>Mon, 29 Dec 2008 16:39:32 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=760#comment-128</guid> <description>But that&#039;s exactly what does happen James!If there is no referrer then the message simply says that the page might never have existed or it&#039;s been moved, deleted, etc.If there is a referrer then that referrer is listed along with a message saying that the referring link is incorrect.There&#039;s also a little magic that goes into the &quot;Possible Match(es)&quot; results. If there is no referrer then the requested URI is broken down into it&#039;s component parts and everything after the domain name is then fed into the search engine.If there is a referrer and that referrer is a search engine, then the query that was submitted to the external search engine is then fed into mine to automatically produce a local search. The results appear as &quot;Possible Match(es)&quot;.I&#039;d like this page to be as helpful and informative as possible and I think I&#039;m getting there. However, I&#039;ll await your post with interest so as I can properly understand what you&#039;re suggesting. If it&#039;s good, I&#039;ll do my utmost to implement it here.Thanks for your contribution.P.S. I&#039;m sorry your original comment got mangled. It seems that WordPress&#039; comment handler doesn&#039;t like code snippets! :-(</description> <content:encoded><![CDATA[<p>But that’s exactly what does happen James!</p><p>If there is no referrer then the message simply says that the page might never have existed or it’s been moved, deleted, etc.</p><p>If there is a referrer then that referrer is listed along with a message saying that the referring link is incorrect.</p><p>There’s also a little magic that goes into the “Possible Match(es)” results. If there is no referrer then the requested <acronym title="Uniform Resource Identifier">URI</acronym> is broken down into it’s component parts and everything after the domain name is then fed into the search engine.</p><p>If there is a referrer and that referrer is a search engine, then the query that was submitted to the external search engine is then fed into mine to automatically produce a local search. The results appear as “Possible Match(es)”.</p><p>I’d like this page to be as helpful and informative as possible and I think I’m getting there. However, I’ll await your post with interest so as I can properly understand what you’re suggesting. If it’s good, I’ll do my utmost to implement it here.</p><p>Thanks for your contribution.</p><p>P.S. I’m sorry your original comment got mangled. It seems that WordPress’ comment handler doesn’t like code snippets! <img src='http://blog.urbanmainframe.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: James John Malcolm</title><link>http://blog.urbanmainframe.com/2008/11/a-better-404/#comment-127</link> <dc:creator>James John Malcolm</dc:creator> <pubDate>Mon, 29 Dec 2008 15:51:11 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=760#comment-127</guid> <description>Ouch my comment really did get mangled there, I&#039;ll put it up on my own blog with some other things I&#039;ve run into.I meant to put a bit of code in that built upon your code, where if there is a referrer, then that output text is written, and if there isn&#039;t, then you get a message where it says: &quot;/requested/uri has been moved, etc. Please try again or try a search.&quot; That should help people coming in from bookmarks or locationbar history.Wouldn&#039;t it also be handy if the request_uri could be used to dish up some possibly related posts?</description> <content:encoded><![CDATA[<p>Ouch my comment really did get mangled there, I’ll put it up on my own blog with some other things I’ve run into.</p><p>I meant to put a bit of code in that built upon your code, where if there is a referrer, then that output text is written, and if there isn’t, then you get a message where it says: “/requested/uri has been moved, etc. Please try again or try a search.” That should help people coming in from bookmarks or locationbar history.</p><p>Wouldn’t it also be handy if the request_uri could be used to dish up some possibly related posts?</p> ]]></content:encoded> </item> <item><title>By: DarkBlue</title><link>http://blog.urbanmainframe.com/2008/11/a-better-404/#comment-122</link> <dc:creator>DarkBlue</dc:creator> <pubDate>Sun, 28 Dec 2008 19:38:56 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=760#comment-122</guid> <description>Thanks for your comment James. I have in fact already got a conditional on the referrer variable. If there is a referrer then the output text is written accordingly. If there is no referrer then no mention of it is made on the 404 page.Is that what you meant or have I misunderstood?</description> <content:encoded><![CDATA[<p>Thanks for your comment James. I have in fact already got a conditional on the referrer variable. If there is a referrer then the output text is written accordingly. If there is no referrer then no mention of it is made on the 404 page.</p><p>Is that what you meant or have I misunderstood?</p> ]]></content:encoded> </item> <item><title>By: James John Malcolm</title><link>http://blog.urbanmainframe.com/2008/11/a-better-404/#comment-120</link> <dc:creator>James John Malcolm</dc:creator> <pubDate>Sun, 28 Dec 2008 18:49:20 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=760#comment-120</guid> <description>You&#039;re on to something, but I&#039;d improve the request_uri part like so:The link at &lt;em&gt;&lt;a&gt;&quot; . $_SERVER[&#039;HTTP_REFERER&#039;] . &quot;&lt;/a&gt;&lt;/em&gt; is incorrect or &lt;em&gt;&quot; . $_SERVER[&#039;REQUEST_URI&#039;] . &quot;&lt;/em&gt; has been moved, renamed or deleted. &lt;?php } else {echo &quot;&lt;em&gt;&quot; . $_SERVER[&#039;REQUEST_URI&#039;]; ?&gt; &lt;/em&gt; has been moved, renamed or deleted. </description> <content:encoded><![CDATA[<p>You’re on to something, but I’d improve the request_uri part like so:</p><p>The link at <em><a>” . $_SERVER[’HTTP_REFERER’] . ”</a></em> is incorrect or <em>” . $_SERVER[’REQUEST_URI’] . ”</em> has been moved, renamed or deleted.<br /> &lt;?php } else {</p><p>echo “<em>” . $_SERVER[’REQUEST_URI’];<br /> ?&gt;<br /> </em> has been moved, renamed or deleted.</p> ]]></content:encoded> </item> <item><title>By: DarkBlue</title><link>http://blog.urbanmainframe.com/2008/11/a-better-404/#comment-98</link> <dc:creator>DarkBlue</dc:creator> <pubDate>Mon, 03 Nov 2008 21:49:26 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=760#comment-98</guid> <description>Glad to be of service Suzanne.</description> <content:encoded><![CDATA[<p>Glad to be of service Suzanne.</p> ]]></content:encoded> </item> <item><title>By: suzanne</title><link>http://blog.urbanmainframe.com/2008/11/a-better-404/#comment-97</link> <dc:creator>suzanne</dc:creator> <pubDate>Mon, 03 Nov 2008 16:16:16 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=760#comment-97</guid> <description>great idea this could be a easier resolution to be fair...i think i may have to give this a whirlthanks</description> <content:encoded><![CDATA[<p>great idea this could be a easier resolution to be fair…i think i may have to give this a whirl</p><p>thanks</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Served from: acmkokecqs.gs01.gridserver.com @ 2010-03-11 18:50:31 by W3 Total Cache -->