Originally posted by Bashar anyone knows if its possible to deny certain IPs from accessing a page inside a dir but not all other pages?
the way that this program works it has all pages including signup page in the root, say i want to allow registration only from certain block but not the world
the signup process works like:
yet i want them to be able to access index.pl for example.
maybe needs mod_rewrite rule to solve the issue or its possible todo it using deny/allow directives in .htaccess?
.htaccess is only to password protect entire directories. And besides, it wouldn't be .htaccess that would handle the IP address denials. It'd be the "Deny From <blah>" directive from within the directory that'd handle the IP address/subnet denial(s). You'd have to move your script into that directory if you wanted to use htaccess.
Perhaps a mod_rewrite rule would work, but if it were me and I had the power of Perl or PHP at my disposal, I'd simply handle it programatically.
You can do this using mod_rewrite and the Files directive. Just as long as your users are not smart enough to know that the sign-up page exists by adding ?func=signup to the URL.
You may be able to alter the existing index.pl and change the word "signup" to something else that nobody will guess.
Put this in a .htaccess file:
RewriteRule signup.html index.pl?func=signup
deny from all
allow from 18.104.22.168
So the above does two things ..
When a user goes to yourdomain.com/signup.html, it will really be pulling up index.pl?func=signup
The second part tells the server to only allow the IP 22.214.171.124 to access the "virtual" signup.html page.