Allowing access to joomla page for ip’s in ‘deny from’

.htaccessjoomla

I notice that my .htaccess file contains

<Files 403.shtml>
order allow,deny
allow from all
</Files>

Which allows the 403 error page, 403.shtml, to be viewed by addresses that are specified on a "deny from" line.

Rather than showing an error page, I would just like to show the home page of the (SEF-enabled joomla) site (not any other pages). My feeble attempt was:

<directory />
order allow,deny
allow from all
<directory>

But that just made the server unhappy.

What is the correct way to do this?

Best Answer

Wrap your Deny directives in a Limit block, so that the 403 only kicks in when the spammer sends a POST request.

<Limit POST>
    Deny from 192.0.2.0/24
    Deny from 10.0.2.1
    # etc
</Limit>

This can be done either in the current location of the Deny directives (the htaccess file) or in your <Directory /> block.

Related Topic