• dbp

    (@optimus203)


    So I’ve been trying to secure my WordPress installations by adding some basic WordPress file protection through .htaccess. It works, but the error pages that are blocked are being directed to a page that simply reads:

    [an error occurred while processing this directive]

    How do I get it to redirect to the 404 page built into theme?

    Here is code for my .htaccess file:

    # Use PHP5.4 as default
    AddHandler application/x-httpd-php54 .php
    
    # 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
    
    # Disable the Server Signature #
    ServerSignature Off
    
    # Deny access to config file #
    <files wp-config.php>
    order allow,deny
    deny from all
    </files>
    
    # Prevent directory browsing #
    Options All -Indexes
    
    # Protect wp-includes folder and files #
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^wp-admin/includes/ - [F,L]
    RewriteRule !^wp-includes/ - [S=3]
    RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
    RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
    RewriteRule ^wp-includes/theme-compat/ - [F,L]
    </IfModule>
    
    # Block Sensitive Files #
    Options All -Indexes
    <files .htaccess>
    Order allow,deny
    Deny from all
    </files>
    <files readme.html>
    Order allow,deny
    Deny from all
    </files>
    <files license.txt>
    Order allow,deny
    Deny from all
    </files>
    <files install.php>
    Order allow,deny
    Deny from all
    </files>
    <files wp-config.php>
    Order allow,deny
    Deny from all
    </files>
    <files error_log>
    Order allow,deny
    Deny from all
    </files>
  • The topic ‘[an error occurred while processing this directive] with custom htaccess protect’ is closed to new replies.