Problems restricting access using Apache
- by Tola Odejayi
I've set up XAMPP on a Windows 7 machine, and I want to restrict access to the htdocs folder to only requests from the local machine. C:\Xampp\htdocs is the web root folder.
I have the following in my apache/conf/httpd.conf file:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "C:/Xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
order deny,allow
deny from all
allow from 127.0.0.1
allow from localhost
</Directory>
All my .htaccess files are blank.
But when I navigate to the web root folder via a browser, I get the following message:
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
I tried adding the IP restrictions to the <Directory>...</Directory>, but it made no difference.
What am I doing wrong here?