Answer the question
In order to leave comments, you need to log in
How to write .htaccess rewrite rule based on client IP?
The task is quite natural: to block access to the site (a special domain allocated to developers for testing purposes) to everyone except for a certain IP. It would seem, what could be easier?
order deny,allow
deny from all
allow from allowed.ip.address
Answer the question
In order to leave comments, you need to log in
To redirect all those who are not destined to get to the site, then:
Give access to files to someone who is lucky enough to visit the site:
<FilesMatch "^(file1|file2)\.html$">
allow from allowed.ip.address
</FilesMatch>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question