WordPress.org

Ready to get started?Download WordPress

Forums

Errordocument 404 .htaccess not working (7 posts)

  1. sugarFornaciari
    Member
    Posted 3 years ago #

    Hi Guys,

    apologize if you think this topic should be already clear, thank to the big amount of threat on the net, but I still can't solve such issue.

    I have just installed a new WP instance on my server and have chosen to show permalink as /%category%/%post%/

    I have created several pages, and actually the home of my blog is a page not a post.

    It works great.

    Only when I try to generate a 404 error instead to be redirect to my error page, I have been redirected to the blog home where I can read the posts with a "DOCUMENT NOT FOUND" disclaimer.

    I have tried the following solution without success:

    * put the following string ErrorDocument 404 /errore-404/
    * also added a 404.php page
    * and also mixed the above mentioned techniques

    here my current .htaccess file
    ---------------------------------------

    # 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]

    </IfModule>

    # END WordPress
    ErrorDocument 404 /errore-404/

    Many thanks,
    Matteo

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Remove the 404 directive from your .htaccess file and then see Creating_an_Error_404_Page.

  3. sugarFornaciari
    Member
    Posted 3 years ago #

    Hi esmi,

    thank for replying.

    Actually I have already seen that post, in fact as I wrote I have already tried to remove the directive from my .htaccess and create a 404.php page.

    I have also tried to keep both but it doesn't work.

    I need to understand why wordpress don't follow the .htaccess directive.
    I wish to use the .htaccess file and maintain the control of the system.

    Anyone could tell me why WP bypass the htaccess file?

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    Because it generates a 404 page dynamically.

  5. sugarFornaciari
    Member
    Posted 3 years ago #

    Ok esmi but how I can block it?

    why if I create a 404.php page and I upload it on the server (alse removing the directive into my .htaccess file) it still doesn't working?

  6. esmi
    Forum Moderator
    Posted 3 years ago #

    Have you tried:

    - deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the Twenty Ten theme to rule out any theme-specific problems.

    - resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

  7. sugarFornaciari
    Member
    Posted 3 years ago #

    ok esmi,
    I have actually found I am a dumm :/ because the 404.php work fine on 20Theme and my previous theme had not a 404.php page.

    When I have put the 404.php page online the file was working fine but that is a work around for me.

    I wish to redirect user on another page using the .htaccess file but it seem impossible to do.

    Any idea?

Topic Closed

This topic has been closed to new replies.

About this Topic