Arez Posted November 6, 2007 Share Posted November 6, 2007 I go to Notepad > Save As > ".htaccess" and then put in "Deny from all" without the quotes, and put it in my htdocs folder. When I go to localhost, it doesn't restrict my viewing. Is this only for IPs? Am I doing something wrong? Quote Link to comment https://forums.phpfreaks.com/topic/76257-htaccess-doesnt-work/ Share on other sites More sharing options...
roopurt18 Posted November 6, 2007 Share Posted November 6, 2007 Look in httpd.conf for a setting: AllowOverride and see what it's set to. If AllowOverride is set to None then .htaccess files won't be allowed to override anything. Quote Link to comment https://forums.phpfreaks.com/topic/76257-htaccess-doesnt-work/#findComment-386012 Share on other sites More sharing options...
Arez Posted November 6, 2007 Author Share Posted November 6, 2007 Worked, thanks! Quote Link to comment https://forums.phpfreaks.com/topic/76257-htaccess-doesnt-work/#findComment-386071 Share on other sites More sharing options...
roopurt18 Posted November 6, 2007 Share Posted November 6, 2007 No problem. If this is a test server you don't have to worry about anything. But on a live production server you need to take care that there are multiple places where you can set this directive. You can set it globally for the entire server, which could be dangerous. The preferred approach is to set this on a per-directory basis down in the NameVirtualHosts stuff. Again, if it's a test server, don't worry about it. Quote Link to comment https://forums.phpfreaks.com/topic/76257-htaccess-doesnt-work/#findComment-386075 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.