Major 404 display error – clashes with Permalinks – any advice?
-
A couple of other forum posts have identified this same error (see this post and this one).
In short: the 404.php error function is failing, displaying a chunk of source code (apparently from the sidebar) instead of the 404 message, as per:
https://www.blogobeer.com/gubbins
This problem is by no means limited to this WP installation – it’s currently affecting every single WP site I’m hosting with Fasthosts (although according to the first linked post, above, the same problem exists on sites hosted with streamline.net as well) with various WP versions from 2.1 through to 2.6 all displaying the same error.
I’ve spoken to Fasthosts support and they’re looking into the issue. We’ve narrowed it down to a clash between some aspect of their server setup (possibly their own management of custom error pages) and the WP .htaccess line:
RewriteRule . /index.php [L]
Removing this line from .htaccess and then stripping out any WP-specific functions from the 404.php file (i.e. <?php get_header(); ?>, <?php get_sidebar(); ?>, <?php get_footer(); ?>) results in the remaining text-based content displaying when a 404 is called. But that same RewriteRule also controls WP’s permalinks, so removing it prevents them from working across the site – not a workable solution.
This seems to be a fairly recent development – the 404 pages all used to work – which suggests a recent change in server management routines has caused the clash. The Fasthosts support guy I’ve been talking to has been extremely helpful and has also managed to get a couple of third-line engineers involved, but in the meantime, he’s asked me to post the following:
When navigating directly to the error page itself you get this error:
Fatal error: Call to undefined function get_header() in /home/fhlinux152/b/blogobeer.com/user/htdocs/wp-content/themes/BoB/404.php on line 1
I think that when the call is made to load the error page by going to a non existent page it is truncating due to the above fatal error. I think a combination of this and possible rewrite rules may be causing the issue.
If anyone here has a better understanding than either of us as to how the .htaccess RewriteRule interfaces with Permanlinks, and how that might be affected by likely linux server settings, please do leave a reply. And if I should be raising this as a bug ticket instead, then please let me know and I’ll get right onto it.
Cheers!
- The topic ‘Major 404 display error – clashes with Permalinks – any advice?’ is closed to new replies.