<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>Custom 404 Error Page with Permalinks plugin</title>
        <link>https://interactivetools.com/forum/forum-posts.php?Custom-404-Error-Page-with-Permalinks-plugin-81362</link>
        <description></description>
        <pubDate>Sat, 11 Jul 2026 20:16:42 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;Custom-404-Error-Page-with-Permalinks-plugin-81362" rel="self" type="application/rss+xml" />

                <item>
          <title>Custom 404 Error Page with Permalinks plugin</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2242270#post2242270</link>
          <description><![CDATA[<p>Hi Greg,</p>
<p>Very good to know.</p>
<p>Thanks so much for the help!</p>
<p>Regards,</p>
<p>Greg</p>]]></description>
          <pubDate>Wed, 04 Jul 2018 02:35:18 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2242270#post2242270</guid>
        </item>
                <item>
          <title>Custom 404 Error Page with Permalinks plugin</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2242260#post2242260</link>
          <description><![CDATA[<p>Hey Greg,</p>
<p>That would work, but I'd recommend including the file path to the file instead of using the URL:</p>
<p><code>  $alternate404Url = "/path/to/404.php";<br />   if (@$alternate404Url) {<br />     dieWith404(file_get_contents($alternate404Url));<br />     exit;<br />   }</code></p>
<p>This is because there is a small chance that the file_get_contents to the URL might cause a 404, which could potentially cause an infinite loop.</p>
<p>Cheers,</p>
<p>Greg</p>]]></description>
          <pubDate>Mon, 02 Jul 2018 13:58:47 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2242260#post2242260</guid>
        </item>
                <item>
          <title>Custom 404 Error Page with Permalinks plugin</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2242249#post2242249</link>
          <description><![CDATA[<p>Thanks, Leo.</p>
<p>Could the plugin code not be changed slightly as follows:</p>
<p><code>  $alternate404Url = "<a href="http://www.mydomain.com/404.php" rel="nofollow">http://www.mydomain.com/404.php</a>";<br />  if (@$alternate404Url) {<br />    dieWith404(file_get_contents($alternate404Url));<br />    exit;<br />  }</code></p>

<p>Would that still redirect and then correctly send the 404 headers?</p>
<p>Thanks,</p>
<p>Greg</p>]]></description>
          <pubDate>Thu, 28 Jun 2018 12:55:21 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2242249#post2242249</guid>
        </item>
                <item>
          <title>Custom 404 Error Page with Permalinks plugin</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2242233#post2242233</link>
          <description><![CDATA[<p>Hi Greg,</p>
<p>Yes, it is because of the redirecting. I would recommend you modify the 404 page to add the libraries you need.</p>
<p>Thanks,</p>]]></description>
          <pubDate>Mon, 25 Jun 2018 11:11:14 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2242233#post2242233</guid>
        </item>
                <item>
          <title>Custom 404 Error Page with Permalinks plugin</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2242228#post2242228</link>
          <description><![CDATA[<p>Hello,</p>
<p>I am trying to customise the 404 error page used by the permalinks plugin.</p>
<p>If I uncomment the variable $alternate404Url and redirect users to my custom page (e.g. 404.php) then when I check the headers of a non existent page using an online tool (such as <a href="https://monitorbacklinks.com/seo-tools/http-header-status-check" rel="nofollow">https://monitorbacklinks.com/seo-tools/http-header-status-check</a>) I receive a 302 found header.</p>
<p>My custom 404 error page is using the following code</p>
<p><code>&lt;?php <br /> // load viewer library<br /> $libraryPath = 'cmsb/lib/viewer_functions.php';<br /> $dirsToCheck = array('/opt/bitnami/apache2/htdocs/','','../','../../','../../../');<br /> foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}<br /> if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }<br /><br /> header("HTTP/1.0 404 Not Found");<br /> $REDIRECT_URL = _permalink_getRedirectUrl();<br /><br /> $title = '404 Error: Page Not Found ';<br /> require('header.php');<br /> ?&gt;<br /><br /> &lt;div id="main-content" class="row"&gt;<br /> &lt;div class="wrapper"&gt;<br /> &lt;div class="col-xs-12"&gt;<br /> &lt;h1 class="search-results"&gt;&lt;strong&gt;Page Not Found&lt;/strong&gt;&lt;/h1&gt;<br /> &lt;/div&gt;<br /> &lt;div class="col-xs-12"&gt;<br /> &lt;hr class="visible-xs visible-sm" /&gt;<br /> &lt;/div&gt;<br /> &lt;div class="col-xs-12"&gt;<br /> &lt;div class="alert alert-danger"&gt;The requested URL was not found on this server.&lt;/div&gt;<br /> &lt;/div&gt;<br /> &lt;/div&gt; &lt;!-- /wrapper --&gt;<br /> &lt;/div&gt; &lt;!-- /main-content --&gt;<br /><br /><br /> &lt;?php require('footer.php'); ?&gt;</code></p>
<p>I thought by specifying header("HTTP/1.0 404 Not Found"); I would return a 404 header. If I check the headers of my custom 404 page then they do return as a 404 but if I check the headers of a non existent page then it's a 302. I guess because it is redirecting...??</p>
<p>Can someone please help?</p>
<p>Thank you,</p>
<p>Greg</p>]]></description>
          <pubDate>Mon, 25 Jun 2018 06:21:44 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2242228#post2242228</guid>
        </item>
              </channel>
    </rss>
  