• When I try to install iThemes Security, it instantly breaks my website with a 500 error. This is the code in the .htaccess file that is causing the problem:

    	<IfModule !mod_authz_core.c>
    		Order allow,deny
    		Allow from all
    		Deny from env=DenyAccess
    		Deny from 140.112.29.131
    		Deny from 2001:41d0:2:b960:0:0:0:0
    		Deny from 207.241.231.63
    	</IfModule>

    I used to be able to delete this code and still able to use the plugin, but now the .htaccess gets edited back instantly. So I can no longer use the plugin.

    • This topic was modified 7 years, 3 months ago by zammbi.
Viewing 5 replies - 1 through 5 (of 5 total)
  • @zammbi

    Look for any relevant errors in the web server error_log.
    This way you can narrow down which line exactly Apache is tripping over.

    What Apache version are you using ?

    Thread Starter zammbi

    (@zammbi)

    No relevant errors in error_log.
    Apache version is 2.2.31.

    @zammbi

    Are you comfortable in doing a little bit of trial and error with the .htaccess ?
    (You’ll need to edit the .htaccess file manually.)

    If so try this block first:

    	<IfModule !mod_authz_core.c>
    		Order allow,deny
    		Allow from all
    #		Deny from env=DenyAccess
    		Deny from 140.112.29.131
    		Deny from 2001:41d0:2:b960:0:0:0:0
    		Deny from 207.241.231.63
    	</IfModule>

    If that still produces a 500 error try this block:

    	<IfModule !mod_authz_core.c>
    		Order allow,deny
    		Allow from all
    #		Deny from env=DenyAccess
    		Deny from 140.112.29.131
    #		Deny from 2001:41d0:2:b960:0:0:0:0
    		Deny from 207.241.231.63
    	</IfModule>

    The above assumes that the related SetEnvIF entries (3) exist in the .htaccess file.
    Below an example of a complete block for a single banned IP address (v4):

    	SetEnvIF REMOTE_ADDR "^3\.3\.3\.3$" DenyAccess
    	SetEnvIF X-FORWARDED-FOR "^3\.3\.3\.3$" DenyAccess
    	SetEnvIF X-CLUSTER-CLIENT-IP "^3\.3\.3\.3$" DenyAccess
    
    	<IfModule mod_authz_core.c>
    		<RequireAll>
    			Require all granted
    			Require not env DenyAccess
    			Require not ip 3.3.3.3
    		</RequireAll>
    	</IfModule>
    	<IfModule !mod_authz_core.c>
    		Order allow,deny
    		Allow from all
    		Deny from env=DenyAccess
    		Deny from 3.3.3.3
    	</IfModule>
    Thread Starter zammbi

    (@zammbi)

    Are you comfortable in doing a little bit of trial and error with the .htaccess ?

    Yep happy to help when I’m free.

    @zammbi

    OK great. Try the suggested code block(s) from my previous post.

    I commented the lines which could be problematic with a hash (#).

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘500 site error, breaks .htaccess’ is closed to new replies.