IP Blocking URLs on Apache
问题 I need to block access to my entire site via IP Address except the url /api which should be open to all. I am currently using ... <LocationMatch /admin> Order Deny,Allow Deny from all Allow from [MY IP] </LocationMatch> this blocks access urls starting with /admin. But I want to block all urls except the ones that start /api. Chris 回答1: RewriteEngine On # (only needs to happen once in .htaccess files. RewriteBase / RewriteCond %{REMOTE_ADDR} !^10\.103\.18\.104 # <--YOUR IP HERE RewriteCond %