Page 1 of 1

Re: php and apache

Posted: Fri Aug 14, 2009 8:37 am
by cpetercarter
I don't understand why someone would want to go to a lot of trouble to build a website and then ban people from seeing it.
However, the answer to your question is 'no'. You can't dynamically modify .htaccess from php. You could however have a database which stored the IP addresses of the folk you wanted to ban, and a procedure for checking the ip address of each request against the banned list.

Re: php and apache

Posted: Fri Aug 14, 2009 8:48 am
by Eran
You can't dynamically modify .htaccess from php
How did you figure that? .htaccess is a regular file and can be modified with PHP. Your database approach is more correct, but the other option is feasible.