Forum Moderators: phranque
\.php?$ Are you talking about blocking https requests (for some reason, there are at least three different ways to express this in mod_rewrite) from everything except selected IPs?
Incidentally, what is \.php?$ intended to mean?
RewriteRule ^(login|or-here|or-here-either)\.php?$ - [F] What the following rule does ..
RewriteCond %{something-defining-https-here} some-value-here
RewriteCond %{REMOTE_ADDR} !^12\.34\.12\.34$ (that is, your own IP) RewriteRule (^|/|\.html)$ - [F] %{HTTPS} on %{SERVER_PORT} 443 (or whatever port number your server uses for secure requests) %{SERVER_PROTOCOL} https %{SSL:variable-name} some-exact-value http://
you could use an additional ruleset:
RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{REMOTE_ADDR} !^my\.ip\.add\.ress$
RewriteRule .* - [F]
Incidentally, what is
\.php?$
I didn't know how to specify an "OR" condition after one rule.
RewriteCond %{SOMETHING} one [OR]
RewriteCond %{OTHERTHING} two [OR]
RewriteCond %{THIRDTHING} three
RewriteCond %{LASTTHING} four
RewriteRule blahblah
Kinda messy though.
I was following this post
http://www.webmasterworld.com/r.cgi?f=92&d=4720632
&url=http://www.webmasterworld.com/postv5.cgi
?action=report&forum=92&discussion=4330904&id=4330939 \.html?$ RewriteCond %{REMOTE_ADDR} ^12\.23\.34\.45$
RewriteRule .? - [L] RewriteRule ^forbidden\.html - [L]