<?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: Script for 404 random page found	</title>
	<atom:link href="https://www.roumazeilles.net/news/en/wordpress/2007/06/14/script-for-404-random-page-found/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.roumazeilles.net/news/en/wordpress/2007/06/14/script-for-404-random-page-found/</link>
	<description>Technology opinions and others</description>
	<lastBuildDate>Sat, 16 Jun 2007 08:43:39 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Yves Roumazeilles		</title>
		<link>https://www.roumazeilles.net/news/en/wordpress/2007/06/14/script-for-404-random-page-found/#comment-1974</link>

		<dc:creator><![CDATA[Yves Roumazeilles]]></dc:creator>
		<pubDate>Sat, 16 Jun 2007 08:43:39 +0000</pubDate>
		<guid isPermaLink="false">https://www.roumazeilles.net/news/en/wordpress/2007/06/14/script-for-404-random-page-found/#comment-1974</guid>

					<description><![CDATA[That&#039;s right, but did you notice that some (one) of the pages are not displayed? Actually, there are authorizations and copyright issues that limited the number of pages I accepted to go to the user. And this was changing pretty often (there is still one page not displayed because of this).

Actually, your solution is nicer for sure.]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s right, but did you notice that some (one) of the pages are not displayed? Actually, there are authorizations and copyright issues that limited the number of pages I accepted to go to the user. And this was changing pretty often (there is still one page not displayed because of this).</p>
<p>Actually, your solution is nicer for sure.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Xtian		</title>
		<link>https://www.roumazeilles.net/news/en/wordpress/2007/06/14/script-for-404-random-page-found/#comment-1971</link>

		<dc:creator><![CDATA[Xtian]]></dc:creator>
		<pubDate>Fri, 15 Jun 2007 22:35:26 +0000</pubDate>
		<guid isPermaLink="false">https://www.roumazeilles.net/news/en/wordpress/2007/06/14/script-for-404-random-page-found/#comment-1971</guid>

					<description><![CDATA[A couple of remarks:

When you redirect an error page, don&#039;t forget to set the error status in your page, otherwise the error is lost. You can add:
header(&quot;Status: 404 Not Found&quot;);

Why don&#039;t you look for all files in the 404 directory and choose one of them?
  $dir = &quot;somewhere/404/&quot;;
  if (is_dir($dir)) {
    if ($dth = opendir($dir)) {
      while (($file = readdir($dth)) !== false) {
        if (preg_match(&#039;/^404-.*\.php$/&#039;, $file) == 1) {
          $address_list[] = $dir . $file;
        }
      }
    }
  }]]></description>
			<content:encoded><![CDATA[<p>A couple of remarks:</p>
<p>When you redirect an error page, don&#8217;t forget to set the error status in your page, otherwise the error is lost. You can add:<br />
header(&#8220;Status: 404 Not Found&#8221;);</p>
<p>Why don&#8217;t you look for all files in the 404 directory and choose one of them?<br />
  $dir = &#8220;somewhere/404/&#8221;;<br />
  if (is_dir($dir)) {<br />
    if ($dth = opendir($dir)) {<br />
      while (($file = readdir($dth)) !== false) {<br />
        if (preg_match(&#8216;/^404-.*\.php$/&#8217;, $file) == 1) {<br />
          $address_list[] = $dir . $file;<br />
        }<br />
      }<br />
    }<br />
  }</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
