Hi.. I am using xammp in my local and trying plan to block a folder. Say my machines IP is 45.45.45.45 and I am accessing the folder names "bob" from another machine (LAN) via http. so http://45.45.45.45/bob works just fine. Now, if I want to block this folder from accessing another machine (LAN), but still need to access to that dir from my local via http (http://localhost/bob), what should my .htaccess file look like. I tried following, but it blocks me accessing this folder from my local machine as well. order deny,allow deny from all allow from localhost
Try: <Limit GET PUT POST> order deny,allow deny from all allow from 127.0.0.1 </Limit> Code (markup): Or change 127.0.0.1 to your machines IP
I just put following on .htaccess file inside the folder that I wanted to restrict. <Limit GET PUT POST> order deny,allow deny from all allow from 127.0.0.1 </Limit> Code (markup): After restarting Apache, I am getting following errors. I also get similar error if use the IP of my local. Server error! The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script. If you think this is a server error, please contact the webmaster. Error 500 127.0.0.1 12/26/2010 11:53:29 AM Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 HTML:
No, that's all I have in my .htaccess file. Just wondering if you happened to test something similar.
Yes, tried it just as I posted it on my xampp install and it worked just fine. The install I have is of 1.7.3 and not customised at all.
Change the Listen directive in your apache config to only listen on 127.0.0.1 There is no need for elaborate .htaccess rules.
jarrodw, If I change the Listen directive in my apache config to only listen on 127.0.0.1, then http://45.45.45.45/bob would not work. If you follow my initial issue.