简体   繁体   中英

<FilesMatch> directive ignored in Apache httpd.conf

So I tried using this in the httpd conf at the bottom of the config file. My goal is to have this rule whitelist the wordpress admin to certain ip addresses. We have a quite a few installs on the server and want to protect this. However when placed, it doesn't recognize the rule and over looks it completely. I've tested it in a virtual hosts .htaccess file to verify the code is working

<FilesMatch "^wp\-login">
order deny,allow
deny from all
allow from 1.2.3.4
</FilesMatch>

Any help is appriciated. Bonus point if someone can get it to redirect the user else where as well. Thanks

use this directive and try

<Files wp-admin.php>
Order allow,deny
Deny from all
</Files> 

or

<Files wp/-admin.php>
Order allow,deny
Deny from all
</Files> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM