Forums

[resolved] .htaccess sending all 404 pages to index page, not error page (2 posts)

  1. richarduk
    Member
    Posted 2 years ago #

    I'm having a problem with .htaccess sending all 404 error pages to the index page

    If I remove the wordpress block the 404 pages all go to the appropriate error page, but the wordpress component of my site doesn't work any more (it shows a 404 error)

    This is the .htaccess file

    <Files .htaccess>
    
    order allow,deny
    
    deny from all
    
    </Files>
    
    ErrorDocument 403 /403.php
    # forbidden
    
    ErrorDocument 404 /404.php
    #not found
    
    ErrorDocument 500 /500.php
    # internal error
    
    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
  2. richarduk
    Member
    Posted 2 years ago #

    Resolved!

    Duh!

    I've spent months on this and now I see the answer as soon as I post the question!

    Simple - I had the error pages in the root of my site, not in my theme directory - so obviously (template hierarchy) since there were no error pages in the theme directory WP used the index page.

    What surprises me is that non-WordPress pages on my 'mixed' site resolve to the correct error page hidden in my theme directory even though I'm using relative urls.

    Doesn't seem to be a cache issue ..

Topic Closed

This topic has been closed to new replies.

About this Topic