Support » Fixing WordPress » Cannot get any 404 redirection to work

  • I’ve tried several 404 redirection plug-ins, but none of them work. I tried the “404 Redirected”, “404 Redirection”, “No 404 Errors”, and “Smart 404” plug-ins — only one at the time, of course. The result is always the same:

    The requested URL /foo.html was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    What could be going on?

    My website is hosted on bluehost.


Viewing 4 replies - 1 through 4 (of 4 total)
  • I got great support from blue host, and they determined that the problem was caused by a blank .htaccess file. I’m not sure what this is, and according to the info I could find about that file, you only need it if you are using pretty permalinks, which I’m not.

    In any case, they placed the following .htaccess, and at least it’s now jumping to the front page on any 404 error. However I still am unable to use any of the 404 plug-ins. The 404 page now always goes to the front page, regardless of settings in the plug-in.


    # BEGIN WordPress

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

    What theme are you using? Many themes define their own 404 page. It is usually named something like 404.php. You can try creating your own 404 page manually and then replacing any appearances of your theme’s 404 page with your own. You can also try a different theme and see if it makes a difference.

    I’m using the Yoko theme. I tried switching themes but the result is always the same. I have pasted 404.template from the Yoko theme below. But I never get to see Yoko’s 404 page, all 404’s directly jump to the home page. I have disabled all 404 related plug-ins.

    The current behavior (404 jumps automatically to home page) is not bad. But it would be nice to get control over it again.

    I did establish that my .htaccess was destroyed by activating the “404 Redirected” plug-in. This plug-in replaces .htaccess with a blank file and does not restore it when deactivated.

    This is the Yoko theme’s 404 template (which I never see so I don’t think it is the problem):

     * @package WordPress
     * @subpackage Yoko
    get_header(); ?>
    <div id="wrap">
    <div id="main">
    	<div id="content">
    		<article id="page">
    			<header class="page-entry-header">
    				<h1 class="entry-title"><?php _e( 'Not Found', 'yoko' ); ?></h1>
    			</header><!-- end page-entry-header -->
    			<div class="single-entry-content">
    				<p><?php _e( 'Apologies, but the page you requested could not be found. Perhaps searching will help.', 'yoko' ); ?></p>
    				<?php get_search_form(); ?>
    			<script type="text/javascript">
    				// focus on search field after it has loaded
    				document.getElementById('s') && document.getElementById('s').focus();
    	</div><!-- end content -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Place a file named 404.php with your custom code in wp-content/yourthemehere and see if that works. If it doesn’t, try a different theme and try doing the same thing. If your theme already has a 404.php file there, be sure to back it up first.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cannot get any 404 redirection to work’ is closed to new replies.