.htaccess - Matching full URL in RewriteCond -
i'm trying block post access site (and return 403), except 2 ip's , 1 url (http://mydomain.com/about-us/contact-us/).
here's have:
rewritecond %{request_method} post rewritecond %{remote_addr} !=1.2.3.4 rewritecond %{remote_addr} !=4.3.2.1 rewritecond %{request_uri} !^http://mydomain.com/about-us/contact-us/$ rewriterule ^ / [f]
these rules allowing access ip properly, contact page still not accessible. i'm not sure i'm using request_uri correctly?
i've tried variations relative urls rewritecond %{request_uri} !^/about-us/contact-us$
, rewritecond %{request_uri} !^/about-us/contact-us/$
without luck.
what doing wrong please?
it looks me rule on file name specific. if relax bit, should work. made few other esthetic tweaks.
give try:
rewritecond %{request_method} post rewritecond %{remote_addr} !^1.2.3.4 rewritecond %{remote_addr} !^4.3.2.1 rewritecond %{request_uri} !about-us/contact-us rewriterule ^ - [f]
Comments
Post a Comment