Apache on WAMP answers 403 Forbidden to other computers on the network
403 ForbiddenShort answer
403 on other devices means an Apache Require rule only trusts local clients. Require local allows 127.0.0.0/8, ::1 and the server's own address, nothing else. Change the rule for the folder or virtual host to allow your network range with Require ip, then test the configuration and restart Apache.
Fix it fast
1Find out which cause you have
Find the Require lines that apply to the site. Open httpd-vhosts.conf and httpd.conf in the WAMP Apache folder, or search them.
findstr /n /i "Require" C:\wamp64\bin\apache\apache2.4.xx\conf\httpd.conf C:\wamp64\bin\apache\apache2.4.xx\conf\extra\httpd-vhosts.conf2Match what you see, then jump to its fix
What does the error look like?
403 Forbiddenhttp://localhost/ works, http://192.168.x.x/ from another device does not
Cause 1 of 3
Require local is in effect
1Check
Apache's mod_authz_host manual says local allows a client matching 127.0.0.0/8, ::1, or the same address as the server. A phone or another PC matches none of these.
findstr /n /i "Require local" C:\wamp64\bin\apache\apache2.4.xx\conf\extra\httpd-vhosts.conf2Fix
Replace it with a rule for your LAN range. Use Require all granted only if you accept every client.
<Directory "c:/wamp64/www/">
Require local
Require ip 192.168.1.0/24
</Directory>3Verify
Test the syntax, restart Apache, then open the PC's address from another device.
httpd -t
curl -I http://192.168.1.10/Confirmed by httpd.apache.org
Cause 2 of 3
Require ip lists the wrong network
1Check
Require ip accepts a full address, a partial address or a CIDR range. A partial address such as 192.168.1 only covers that subnet, so a device on 192.168.0.x is refused.
ipconfig2Fix
Make the range match the network the other device is on.
Require ip 192.168.0.0/243Verify
Restart Apache and request the page from that device.
httpd -tConfirmed by httpd.apache.org
Cause 3 of 3
Require host fails on reverse DNS
1Check
The manual says Require host makes Apache do a double reverse DNS lookup, and access is allowed only if forward and reverse DNS agree and the name matches. Home devices often fail this.
findstr /n /i "Require host" C:\wamp64\bin\apache\apache2.4.xx\conf\httpd.conf2Fix
Use Require ip with the network range instead.
Require ip 192.168.1.0/243Verify
Restart Apache and retry from the other device.
httpd -tConfirmed by httpd.apache.org
How do I stop it coming back?
- Allow a network range with Require ip, not Require all granted, on a machine that is reachable from other networks.
- Run httpd -t after every change to the configuration.
- Give the PC a fixed LAN address so your Require ip range keeps working.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Related fixes
Servers
Status code 460 on an AWS Application Load Balancer
elb_status_code 460 in ALB access logs
A 460 is generated by the load balancer, not by your app.
3 causes, each with a fixServers
Application Load Balancer returns 504 for requests to EC2 instances
HTTPCode_ELB_504_Count
A 504 from an Application Load Balancer means it could not get an answer from a target in time.
4 causes, each with a fixServers
apk cannot find py-pip in an Alpine Docker image
py-pip (no such package):
On current Alpine releases there is no package called py-pip.
2 causes, each with a fixServers
dnf cannot install MySQL on Amazon Linux 2023
dnf cannot find a mysql-server package on Amazon Linux 2023
Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.
3 causes, each with a fixServers
ng serve runs in the container but localhost:4200 does not open
The browser cannot open localhost:4200 although ng serve is running in the container
ng serve listens on localhost by default, which inside a container is the container itself.
3 causes, each with a fixServers
Angular routes return 404 from nginx when you refresh or open a link
The home page loads, but refreshing /some/route shows an nginx 404
Angular routes like /users/42 are not files, so nginx looks for them on disk and returns 404.
3 causes, each with a fix