HI all.,
Is it possible to block a subdomain or a one lower level directory URL access from other hosts or network ? I have a site running on my server and i want to block the particular directory under the domain, with the exception of loopback access? I mean the directory must be accessible from loopback/localhost.
http://mydomain.com/sub on port 10016(expect loopback)
http://mydomain.com/sub/sub1 on port 10016 (expect loopback)
please suggest
Code:
iptables -I INPUT 1 -i lo -p tcp --dport 10016 -m string -algo kmp --string "mydomain/sub" -j ACCEPT
iptables -I INPUT 2 -i lo -p tcp --dport 10016 -m string -algo kmp --string "mydomain/sub/sub1" -j ACCEPT
iptables -I INPUT 3 -i eth0 -p tcp --dport 10016 -m string -algo kmp --string "mydomain/sub" -j DROP
iptables -I INPUT 4 -i eth0 -p tcp --dport 10016 -m string -algo kmp --string "mydomain/sub/sub1" -j DROP