<?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>Baliプロジェクト &#187; 404エラー</title>
	<atom:link href="http://bali.to/archives/tag/404%e3%82%a8%e3%83%a9%e3%83%bc/feed" rel="self" type="application/rss+xml" />
	<link>http://bali.to</link>
	<description>ソフトウェアの研究所</description>
	<lastBuildDate>Wed, 09 Dec 2009 00:24:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>404エラーページを作成</title>
		<link>http://bali.to/archives/16</link>
		<comments>http://bali.to/archives/16#comments</comments>
		<pubDate>Tue, 02 Dec 2008 09:51:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPressの工房]]></category>
		<category><![CDATA[404エラー]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[ページ]]></category>
		<category><![CDATA[裏技]]></category>

		<guid isPermaLink="false">http://bali.to/?p=16</guid>
		<description><![CDATA[エラーページを作成するために、簡単に述べてみます。まず通常のファイルを404.phpへコピーして、不要なもの及びループの関数を削除します。最後にquery_posts関数を利用して、最近の投稿を表示させます。
例として、次のように404.phpスクリプトを作成してみます。

&#60;?php get_header(); ?&#62;

	&#60;h1&#62;404 - エラー&#60;/h1&#62;

	&#60;p&#62;みたいページは存在していません。&#60;/p&#62;
	&#60;p&#62;どちらかを選択して、お進めください。&#60;/p&#62;

	&#60;ul&#62;
		&#60;li&#62;検索フォームからページを検索ください。&#60;/li&#62;
		&#60;li&#62;トップページ &#60;a href=&#34;http://bali.to/&#34;&#62;へアクセスください。&#60;/a&#62;&#60;/li&#62;
		&#60;li&#62; &#60;/a&#62;&#60;a href=&#34;http://bali.to/archives/&#34;&#62;アーカーブ&#60;/a&#62;を探していますか。&#60;/li&#62;
		&#60;li&#62;あるいは最近の記事を下記のように確認ください。&#60;/li&#62;
	&#60;/ul&#62;

	&#60;h3&#62;最近の記事&#60;/h3&#62;

	&#60;ul&#62;
	&#60;?php
	query_posts('posts_per_page=5');
	if (have_posts()) : while (have_posts()) : the_post(); ?&#62;
	&#60;li&#62;&#60;a href=&#34;&#60;?php the_permalink() ?&#62;&#34; title=&#34;Permalink for : &#60;?php the_title(); ?&#62;&#34;&#62;&#60;?php the_title(); ?&#62;&#60;/a&#62;
	&#60;?php endwhile; endif; ?&#62;
	&#60;/ul&#62;

&#60;?php get_footer(); ?&#62;

簡単ですよね。自分の好みで色々追加することもできますので、試してください。
404エラーがあった時に、特定のページをアクセスするように誘導するために、.htaccessファイルでも設定できます。
例として、.htaccessファイルに次の設定を追加してみてください。
ErrorDocument 404 /index.php?error=404
設定に旨く行かない場合、この記事をコメントください。
]]></description>
		<wfw:commentRss>http://bali.to/archives/16/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
