<?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: Custom 404 error messages with CodeIgniter</title>
	<atom:link href="http://www.kelvinluck.com/2009/04/custom-404-error-messages-with-codeigniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kelvinluck.com/2009/04/custom-404-error-messages-with-codeigniter/</link>
	<description>a stroke of luck</description>
	<lastBuildDate>Thu, 02 Feb 2012 07:32:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: lalit</title>
		<link>http://www.kelvinluck.com/2009/04/custom-404-error-messages-with-codeigniter/comment-page-1/#comment-66332</link>
		<dc:creator>lalit</dc:creator>
		<pubDate>Thu, 26 May 2011 07:12:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.kelvinluck.com/?p=717#comment-66332</guid>
		<description>hey kelvin,

i need some help where could i write my error handling code..??
Becz i dnt knw mch more about codeigniter..
I hv code of error handling mention above in ur post...

So any idea..??
Help and pull me out from tense..</description>
		<content:encoded><![CDATA[<p>hey kelvin,</p>
<p>i need some help where could i write my error handling code..??<br />
Becz i dnt knw mch more about codeigniter..<br />
I hv code of error handling mention above in ur post...</p>
<p>So any idea..??<br />
Help and pull me out from tense..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://www.kelvinluck.com/2009/04/custom-404-error-messages-with-codeigniter/comment-page-1/#comment-45058</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Mon, 06 Sep 2010 09:59:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.kelvinluck.com/?p=717#comment-45058</guid>
		<description>I use only this single line of code in my error template file (/system/application/errors/error_404.php):

&lt;?php echo file_get_contents(&#039;http://&#039; . $_SERVER[&#039;HTTP_HOST&#039;] . &#039;/home/page_not_found&#039;);

No need of extending any CI core classes. If you need to show your own error page at the web server level (i.e. when accessing resources not parsed by your CI installation), you could also do something like this (depending on your host configuration of course):

ErrorDoc 404 /home/page_not_found

Hope this helps!</description>
		<content:encoded><![CDATA[<p>I use only this single line of code in my error template file (/system/application/errors/error_404.php):</p>
<p>&lt;?php echo file_get_contents(&#039;<a href="http://&#038;#039" rel="nofollow">http://&#038;#039</a>; . $_SERVER[&#039;HTTP_HOST&#039;] . &#039;/home/page_not_found&#039;);</p>
<p>No need of extending any CI core classes. If you need to show your own error page at the web server level (i.e. when accessing resources not parsed by your CI installation), you could also do something like this (depending on your host configuration of course):</p>
<p>ErrorDoc 404 /home/page_not_found</p>
<p>Hope this helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kelvin Luck</title>
		<link>http://www.kelvinluck.com/2009/04/custom-404-error-messages-with-codeigniter/comment-page-1/#comment-40678</link>
		<dc:creator>Kelvin Luck</dc:creator>
		<pubDate>Mon, 12 Jul 2010 14:53:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.kelvinluck.com/?p=717#comment-40678</guid>
		<description>That&#039;s an interesting approach Jeremy - it certainly seems cleaner to me if it works... As mentioned above, I now use Kohana and can handle 404s in a much cleaner way but your suggestion may be useful for anyone who uses CI...</description>
		<content:encoded><![CDATA[<p>That's an interesting approach Jeremy - it certainly seems cleaner to me if it works... As mentioned above, I now use Kohana and can handle 404s in a much cleaner way but your suggestion may be useful for anyone who uses CI...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Lawson</title>
		<link>http://www.kelvinluck.com/2009/04/custom-404-error-messages-with-codeigniter/comment-page-1/#comment-40189</link>
		<dc:creator>Jeremy Lawson</dc:creator>
		<pubDate>Wed, 07 Jul 2010 03:10:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.kelvinluck.com/?p=717#comment-40189</guid>
		<description>That&#039;s an interesting solution.

I, too, decided on a custom error controller/method.

Did you consider using apache&#039;s ErrorDocument statement to decide how to route the error?

For example, I have the following:

ErrorDocument 404 /index.php/main/page_not_found</description>
		<content:encoded><![CDATA[<p>That's an interesting solution.</p>
<p>I, too, decided on a custom error controller/method.</p>
<p>Did you consider using apache's ErrorDocument statement to decide how to route the error?</p>
<p>For example, I have the following:</p>
<p>ErrorDocument 404 /index.php/main/page_not_found</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kelvin Luck</title>
		<link>http://www.kelvinluck.com/2009/04/custom-404-error-messages-with-codeigniter/comment-page-1/#comment-33981</link>
		<dc:creator>Kelvin Luck</dc:creator>
		<pubDate>Fri, 07 May 2010 10:25:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.kelvinluck.com/?p=717#comment-33981</guid>
		<description>I&#039;m afraid that I&#039;ve stopped using Code Igniter (I now use Kohana 3)... It is a lot more graceful and easier there (you can throw and error and catch it and display the 404 page at the base render level).

However, I did run into this problem when I was using CI and the simple solution I used was to pass an additional get parameter in the CURL request - something like ?isAdmin=1. This would display the admin link (and is still secure because the link only actually works if you are logged in),

Hope it helps,

Kelvin :)</description>
		<content:encoded><![CDATA[<p>I'm afraid that I've stopped using Code Igniter (I now use Kohana 3)... It is a lot more graceful and easier there (you can throw and error and catch it and display the 404 page at the base render level).</p>
<p>However, I did run into this problem when I was using CI and the simple solution I used was to pass an additional get parameter in the CURL request - something like ?isAdmin=1. This would display the admin link (and is still secure because the link only actually works if you are logged in),</p>
<p>Hope it helps,</p>
<p>Kelvin :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurence Wilks</title>
		<link>http://www.kelvinluck.com/2009/04/custom-404-error-messages-with-codeigniter/comment-page-1/#comment-33976</link>
		<dc:creator>Laurence Wilks</dc:creator>
		<pubDate>Fri, 07 May 2010 09:28:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.kelvinluck.com/?p=717#comment-33976</guid>
		<description>Hi Kevin

I really like your solution the only issue I now have is that the session id changes (because of using CURL I assume) so if I&#039;m logged in to my admin panel and then click on a link that generates a 404 error I lose my admin menus.

I can&#039;t see any way around this, any ideas?</description>
		<content:encoded><![CDATA[<p>Hi Kevin</p>
<p>I really like your solution the only issue I now have is that the session id changes (because of using CURL I assume) so if I'm logged in to my admin panel and then click on a link that generates a 404 error I lose my admin menus.</p>
<p>I can't see any way around this, any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johnny</title>
		<link>http://www.kelvinluck.com/2009/04/custom-404-error-messages-with-codeigniter/comment-page-1/#comment-27588</link>
		<dc:creator>Johnny</dc:creator>
		<pubDate>Wed, 17 Feb 2010 09:44:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.kelvinluck.com/?p=717#comment-27588</guid>
		<description>Nice bit of code Kelvin... works like a charm!</description>
		<content:encoded><![CDATA[<p>Nice bit of code Kelvin... works like a charm!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ONe</title>
		<link>http://www.kelvinluck.com/2009/04/custom-404-error-messages-with-codeigniter/comment-page-1/#comment-22538</link>
		<dc:creator>ONe</dc:creator>
		<pubDate>Sat, 14 Nov 2009 00:46:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.kelvinluck.com/?p=717#comment-22538</guid>
		<description>Hi Kelvin. I&#039;ve been reading the codeigniter forums trying to figure out the best solution to handle 404 errors and I found your approarch very interesting. Im using it now in my website, but I dont fully understand one thing about your implementation. You use this route to handle 404&#039;s:

$route[&#039;(:any)&#039;] = &quot;home/$1&quot;;

But it doesnt work for me adding the last &quot;/$1&quot;. Actually, how could it possibly work with &quot;$1&quot;? Using just :

$route[&#039;(:any)&#039;] = &quot;errorController&quot;;

makes sense to me. If you add the last &quot;/$1&quot;, how does it know which function of the controller should it use? It would be different every time.

I hope you understand my question :P
Thanks for your idea and your time!</description>
		<content:encoded><![CDATA[<p>Hi Kelvin. I've been reading the codeigniter forums trying to figure out the best solution to handle 404 errors and I found your approarch very interesting. Im using it now in my website, but I dont fully understand one thing about your implementation. You use this route to handle 404's:</p>
<p>$route['(:any)'] = "home/$1";</p>
<p>But it doesnt work for me adding the last "/$1". Actually, how could it possibly work with "$1"? Using just :</p>
<p>$route['(:any)'] = "errorController";</p>
<p>makes sense to me. If you add the last "/$1", how does it know which function of the controller should it use? It would be different every time.</p>
<p>I hope you understand my question :P<br />
Thanks for your idea and your time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kelvin Luck</title>
		<link>http://www.kelvinluck.com/2009/04/custom-404-error-messages-with-codeigniter/comment-page-1/#comment-20894</link>
		<dc:creator>Kelvin Luck</dc:creator>
		<pubDate>Thu, 22 Oct 2009 10:05:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.kelvinluck.com/?p=717#comment-20894</guid>
		<description>I just use $_SERVER[&#039;HTTP_HOST&#039;] and $_SERVER[&#039;REQUEST_URI&#039;]...</description>
		<content:encoded><![CDATA[<p>I just use $_SERVER['HTTP_HOST'] and $_SERVER['REQUEST_URI']...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurence Wilks</title>
		<link>http://www.kelvinluck.com/2009/04/custom-404-error-messages-with-codeigniter/comment-page-1/#comment-20859</link>
		<dc:creator>Laurence Wilks</dc:creator>
		<pubDate>Wed, 21 Oct 2009 15:54:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.kelvinluck.com/?p=717#comment-20859</guid>
		<description>Hi

Am I being dim? How did you echo out the &#039;not found&#039; URL in your view file in the example i.e.:

http://www.sharify.it/how-it-works1</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>Am I being dim? How did you echo out the 'not found' URL in your view file in the example i.e.:</p>
<p><a href="http://www.sharify.it/how-it-works1" rel="nofollow">http://www.sharify.it/how-it-works1</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.597 seconds -->

