Restrict URL's starting with /abc to specific IP's [.htaccess guru]
PermalinkI'm trying to protect URL's, starting with a specific slug (let's say /abc), by allowing specific IP's only. Let us assume my IP address is 123.123.123.123. I have the following htaccess code, which does the exact opposite (only allowing /abc and blocking the rest):
Now, does anyone know how to turn that around? So allow everything, EXCEPT the URL's starting with /abc? I tried removing the exclamation mark and several other things, with no success. The code above works though, but that's not what I want to achieve unfortunately.
RewriteCond %{REQUEST_URI} !^/abc RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.123 RewriteRule ^(.*)$ - [R=403,L] # 好像 要把 前后的^和$去掉
Now, does anyone know how to turn that around? So allow everything, EXCEPT the URL's starting with /abc? I tried removing the exclamation mark and several other things, with no success. The code above works though, but that's not what I want to achieve unfortunately.
if the url begins with /abc and the remote address is not one of the three listed, send the browser on its merry way.
来自 https://www.concrete5.org/community/forums/chat/restrict-urls-starting-with-abc-to-specific-ips-.hta...