Your site, or one folder of it, returns a plain 403 Forbidden. You've already checked the file permissions and they're fine: 644 for files, 755 for folders, owned by the right user. Then you open the Apache error log and find this line over and over:
[authz_core:error] [pid 21844] [client 203.0.113.45:51022] AH01630: client denied by server configuration: /home/user/public_html/app/
That message tells you a lot. Apache could read the file without trouble. It refused because an access rule told it to. So chmod won't help here. You have to find the rule that's blocking the request. This guide shows where those rules hide on cPanel accounts and on VPS servers you run yourself, and how to fix each one without opening up folders that should stay locked.
Symptom: How AH01630 Shows Up
- The browser shows "403 Forbidden – You don't have permission to access this resource."
- Sometimes only one path is affected:
/wp-admin/,/api/, a subfolder, or one file type like.jsonor.xml. - It often starts right after a server upgrade, a migration from an old host, or a fresh VPS build where you set up a new virtual host.
- The error log has
AH01630: client denied by server configuration. You might also see the close relativeAH01797: client denied by server configuration, which comes from the legacymod_access_compatrules.
Where to find the log:
| Setup | Error log location |
|---|---|
| cPanel (user) | cPanel → Metrics → Errors (shows the last 300 lines) |
| cPanel/WHM (root) | /usr/local/apache/logs/error_log or /etc/apache2/logs/error_log |
| Ubuntu/Debian VPS | /var/log/apache2/error.log |
| AlmaLinux/Rocky VPS | /var/log/httpd/error_log |
Run tail -f on the log, reload the broken page, and copy the exact path Apache prints. That path tells you which directory's rules are doing the blocking.
Cause: Why Apache Is Saying No
Since Apache 2.4, access control is handled by mod_authz_core using Require directives. AH01630 means a Require check came back negative for the request. In practice the cause is almost always one of these:
- Old Apache 2.2 syntax (
Order deny,allow/Deny from all) left in an.htaccessfile, usually carried over from an old host or an old plugin. - A
Require all deniedor aRequire iprule that doesn't include your IP, in.htaccessor the vhost. - A missing
<Directory>block on a VPS. Apache's default config denies everything under/, so any DocumentRoot outside/var/wwwstays blocked until you allow it explicitly. - A
<FilesMatch>rule from a security plugin that blocks file extensions like.phpinsideuploads/or.txt/.logsite-wide. - Mixing old and new syntax in the same scope. When
mod_access_compatis loaded, both rule sets get evaluated, and the results can surprise you.
Fix: Step by Step
Step 1: Find every .htaccess between the docroot and the blocked path
Apache merges .htaccess files from the document root down to the folder being requested. If the request is /app/api/, it checks public_html/.htaccess, public_html/app/.htaccess and public_html/app/api/.htaccess. Over SSH:
cd ~/public_html
grep -rnEi --include=".htaccess" "deny|allow|order|require|filesmatch" .
In cPanel File Manager, click Settings → Show Hidden Files (dotfiles) first, or you won't see these files at all.
Step 2: Convert legacy Order/Deny/Allow rules
Here's what to replace and what to replace it with:
| Apache 2.2 (old) | Apache 2.4 (current) |
|---|---|
Order deny,allowDeny from all | Require all denied |
Order allow,denyAllow from all | Require all granted |
Order deny,allowDeny from allAllow from 203.0.113.45 | Require ip 203.0.113.45 |
Deny from 198.51.100.7 | <RequireAll>Require all grantedRequire not ip 198.51.100.7</RequireAll> |
Don't keep both versions side by side "just in case." Pick 2.4 syntax and delete the old lines from that file. Mixed rules are the most common reason this error keeps coming back after someone has "fixed" it.
Step 3: Check IP allowlists, especially on admin folders
Plenty of people lock /wp-admin/ or a custom admin panel to their office IP and then forget about it. Your ISP gives you a new IP, or you switch to mobile data, and suddenly you're locked out. Check what IP the server actually sees:
curl -s https://ifconfig.me
Then update the rule. You can list several addresses or a whole range:
<RequireAny>
Require ip 203.0.113.45
Require ip 198.51.100.0/24
</RequireAny>
If your site is behind Cloudflare, Apache sees Cloudflare's IP instead of yours unless mod_remoteip is configured. Then every Require ip rule fails. Either set up RemoteIPHeader CF-Connecting-IP with Cloudflare's ranges as RemoteIPTrustedProxy, or move the IP restriction to a Cloudflare WAF rule.
Step 4: Look for FilesMatch blocks from security plugins
Security plugins and hardening guides add rules like this:
<FilesMatch "\.(txt|log|json|xml)$">
Require all denied
</FilesMatch>
That one rule also blocks robots.txt, sitemap.xml and any JSON file your front end fetches. Narrow the pattern to the files that actually need protecting, for example "^(debug\.log|error_log|\.env)$", rather than whole extensions.
Step 5 (VPS only): Add a Directory block for your DocumentRoot
If you built the server yourself and put the site in /srv/mysite or /home/deploy/site, Apache's default root rule blocks it:
<Directory />
AllowOverride None
Require all denied
</Directory>
Add an explicit allow inside your virtual host:
<VirtualHost *:80>
ServerName example.com
DocumentRoot /srv/mysite/public
<Directory /srv/mysite/public>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Test before reloading. A typo here can take down every site on the box:
# Ubuntu/Debian
sudo apache2ctl configtest && sudo systemctl reload apache2
# AlmaLinux/Rocky
sudo apachectl configtest && sudo systemctl reload httpd
On cPanel servers, don't edit httpd.conf directly, because it gets rebuilt. Put custom directives in an include file under /etc/apache2/conf.d/userdata/std/2_4/<user>/<domain>/, then run /scripts/rebuildhttpdconf and restart Apache.
Step 6: Find out whether mod_access_compat is loaded
apachectl -M | grep -E "access_compat|authz_core"
If access_compat_module shows up, old Deny from rules are still being enforced (that's where AH01797 comes from). Once you've converted all your rules, you can disable the module on a VPS with sudo a2dismod access_compat (Debian/Ubuntu). After that, any leftover legacy line throws a clear syntax error instead of quietly blocking visitors.
Quick Isolation Trick
Not sure which file is the culprit? Rename the .htaccess in the deepest affected folder to .htaccess.off and reload. If the 403 goes away, the problem is in that file. If it doesn't, put it back and try the next folder up. Take a copy before you start (cp .htaccess .htaccess.bak) and always rename files back once you're done. A WordPress .htaccess also holds your permalink rules.
Prevention
- After every migration, run
grep -rn "Deny from\|Order deny" ~/public_html --include=.htaccessand convert anything it finds. - Use dynamic IP ranges, or better, 2FA plus a login rate limit, instead of single-IP admin locks you'll forget about.
- Write down every access rule you add with a comment line (
# added 2026-11 to block uploads PHP) so the next person knows why it's there. - Keep custom vhost directives in include files on cPanel so EasyApache rebuilds don't wipe them.
- Watch the error log after installing security plugins. A spike of AH01630 entries right after an install usually means a rule is too broad.
Frequently Asked Questions
Is AH01630 a file permission problem?
No. Permission problems log as (13)Permission denied or AH00132. AH01630 means Apache could read the file but an access-control rule (Require, Deny, FilesMatch) refused the request. Changing chmod won't fix it.
Why did this start after my host upgraded Apache?
Older setups often had mod_access_compat enabled, which quietly handled 2.2-style Order/Deny rules. When it's removed, or when old and new rules end up in the same scope, legacy lines can start denying everyone. Convert them to Require syntax.
Can I just put "Require all granted" in public_html/.htaccess to fix everything?
It might override some rules, but it can also unblock folders that were locked on purpose, like backup directories or .git. Find the specific rule that's blocking the path and fix that instead.
Only robots.txt and sitemap.xml return 403. Why?
Almost always a <FilesMatch> rule that denies .txt or .xml extensions, usually added by a security plugin or a copied hardening snippet. Narrow the pattern so it only matches the sensitive files.
I'm on Cloudflare and my IP allowlist stopped working. What happened?
Apache sees Cloudflare's edge IPs instead of yours, so Require ip never matches. Configure mod_remoteip with the CF-Connecting-IP header and Cloudflare's trusted proxy ranges, or move the restriction into a Cloudflare WAF rule.
