1

I have local page. All I want to access it from my phone and my computer. There is no chance to have static IP.

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} !MyUserAgent [NC]
RewriteRule ^ - [F,L]

Order Deny,Allow
Deny from all
Allow from MYLocalIp

These codes are not working together. How can I use them together?

anubhava
  • 761,203
  • 64
  • 569
  • 643
Rıdvan Çetin
  • 183
  • 5
  • 16

1 Answers1

0

This all can be done in single rewrite rule itself:

RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} !MyUserAgent [NC,OR]
RewriteCond %{REMOTE_ADDR} !=11.22.33.44
RewriteRule ^ - [F,L]

Where 11.22.33.44 is your local IP address.

anubhava
  • 761,203
  • 64
  • 569
  • 643