Allow other instances of files that is globally blocked in htaccess?

0

I am using the following command inside home/ to block all access to wp_login.php

<Files wp-login.php>
order deny,allow
deny from all    
</Files>

How can I allow certain instances of wp_login.php for example, allow:

home/bob/public_html/wp_login.php

and

home/jim/public_html/wordpress/wp_login.php ?

IMB

Posted 2013-04-10T04:46:41.833

Reputation: 4 845

To all who are voting to migrate to webapps this isn't on-topic for them. It's a valid question for here. – James Mertz – 2013-04-10T18:26:18.617

Answers

2

You would need the appropriate .htaccess file in the new directories stating that the wp-login.php files in those are allowed access.

Apache will check the .htaccess file in the current directory, then "backtrack" until it hits the DocumentRoot. The most relevant directive will apply, therefore a deny in /home and an allow in /home/user/ will allow access to the instance in the user directory, while denying everywhere else under /home.

It does not seem possible to have all directives in the same .htaccess file; in that case, the deny rule seems to override the others (just tested on Apache 2.2.22).

LSerni

Posted 2013-04-10T04:46:41.833

Reputation: 7 306