<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>KNGUYENTU - PHOTOGRAPHY BY KEVIN &#38; SAP HELP BY KEVIN &#187; Error 404</title>
	<atom:link href="http://knguyentu.com/wordpress/tag/error-404/feed/" rel="self" type="application/rss+xml" />
	<link>http://knguyentu.com/wordpress</link>
	<description>Home Of SAPHELPBYKEVIN.COM , PHOTOGRAPHYBYKEVIN.NET &#38; Smilepak Blog</description>
	<lastBuildDate>Thu, 05 Nov 2009 21:37:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>WP-Tips: Error 404 Page Not Found Bug!</title>
		<link>http://knguyentu.com/wordpress/2008/06/wp-error-404-page-not-found-bug/</link>
		<comments>http://knguyentu.com/wordpress/2008/06/wp-error-404-page-not-found-bug/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 17:30:36 +0000</pubDate>
		<dc:creator>dikiem</dc:creator>
				<category><![CDATA[WordPress Tips and Hack]]></category>
		<category><![CDATA[Error 404]]></category>
		<category><![CDATA[Page Not Found]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://knguyentu.com/wordpress/?p=116</guid>
		<description><![CDATA[I had spent a whole day on the weekend trying to figure out why my .htaccess setup and error 404 is not working on wordpress. After numerous posts reading and blogs reading, I came across a site that perfectly describe the issue. Turn out it is a bug in version 2.5 and higher. This was [...]]]></description>
			<content:encoded><![CDATA[<p>I had spent a whole day on the weekend trying to figure out why my .htaccess setup and error 404 is not working on wordpress. After numerous posts reading and blogs reading, I came across a site that perfectly describe the issue. Turn out it is a bug in version 2.5 and higher. This was suppose to be resolved in version 2.5.1, but never did.</p>
<p>It has to do with this page of code inside the ./wp-includes/query.php file.</p>
<p><code>if ( ('page' != get_option('show_on_front') ) || <strong><span style="color: #0000ff;">( $reqpage != get_option('page_for_posts')</span></strong> ) ) {<br />
$q['pagename'] = str_replace('%2F', '/', urlencode(urldecode($q['pagename'])));<br />
$page_paths = '/' . trim($q['pagename'], '/');<br />
$q['pagename'] = sanitize_title(basename($page_paths));<br />
$q['name'] = $q['pagename'];<br />
$where .= " AND (ID = '$reqpage')";<br />
$reqpage_obj = get_page($reqpage);<br />
if ( 'attachment' == $reqpage_obj-&gt;post_type ) {<br />
$this-&gt;is_attachment = true;<br />
$this-&gt;is_page = true;<br />
$q['attachment_id'] = $reqpage;<br />
}</code></p>
<p>Notice the part in <strong><span style="color: #0000ff;">BOLD BLUE</span></strong>. The bug is exactly right there. In line 922 of ./wp-includes/query.php file. By adding an additional &#8220;=&#8221; resolved the issue. The end result will look like</p>
<p><code>if ( ('page' != get_option('show_on_front') ) || <strong><span style="color: #0000ff;">( $reqpage !== get_option('page_for_posts')</span></strong> ) ) {<br />
$q['pagename'] = str_replace('%2F', '/', urlencode(urldecode($q['pagename'])));<br />
$page_paths = '/' . trim($q['pagename'], '/');<br />
$q['pagename'] = sanitize_title(basename($page_paths));<br />
$q['name'] = $q['pagename'];<br />
$where .= " AND (ID = '$reqpage')";<br />
$reqpage_obj = get_page($reqpage);<br />
if ( 'attachment' == $reqpage_obj-&gt;post_type ) {<br />
$this-&gt;is_attachment = true;<br />
$this-&gt;is_page = true;<br />
$q['attachment_id'] = $reqpage;<br />
}</code></p>
<p>This will get wordpress to properly recognize improper URL call and redirect the post properly to your 404.php file.</p>
<p>Not sure how to create one? If your theme doesn&#8217;t come with one already, you can easily create a very simple 404 error page. Just create a file and name it 404.php. Place that in the same folder as all the other php file of your theme, including the index.php file.</p>
<p>In the 404.php, you could be as basic as this</p>
<p><CODE><br />
&lt;?php ob_start(); ?&gt;<br />
&lt;?php header(&#8220;HTTP/1.1 404 Not Found&#8221;); ?&gt;<br />
&lt;?php header(&#8220;Status: 404 Not Found&#8221;); ?&gt;<br />
&lt;?php get_header(); ?&gt;</p>
<p>	&lt;div id=&#8221;content&#8221;&gt;<br />
			&lt;h1&gt;Error 404: Doh!&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;</p>
<p>	&lt;/div&gt;<br />
&lt;?php get_sidebar(); ?&gt;<br />
&lt;?php get_footer(); ?&gt;<br />
</CODE></p>
<p>You could read up more about it at Wordpress.org or by clicking on this <a href="http://codex.wordpress.org/Creating_an_Error_404_Page">LINK</a></p>

<div class='amazonfeed'><h2>Hot Items From Amazon!</h2>
<div class='product'><a href='http://www.amazon.com/David-Buschs-Quick-Photoblogging-Wordpress/dp/B0032K6MDY?SubscriptionId=0K71XE306HCHA9WYBS02&tag=photographbyk-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B0032K6MDY' target='_blank' rel='nofollow'><img src='http://ecx.images-amazon.com/images/I/31IeYUY5EuL._SL75_.jpg' class='amazonfeed-product-image' alt='David Busch&#039;s Quick Snap Guide to Photoblogging wwith Wordpress: An Instant Start-up Manual for Creating &amp; Promoting Your Photoblog, Softcover Book, 205 Pages' title='David Busch&#039;s Quick Snap Guide to Photoblogging wwith Wordpress: An Instant Start-up Manual for Creating &amp; Promoting Your Photoblog, Softcover Book, 205 Pages' /><span class='amazonfeed-product-title'>David Busch's Quick Snap Guide to Photoblogging wwith Wordpress: An Instant Start-up Manual for Creating & Promoting Your Photoblog, Softcover Book, 205 Pages</span></a>
</div></div>]]></content:encoded>
			<wfw:commentRss>http://knguyentu.com/wordpress/2008/06/wp-error-404-page-not-found-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
