
A 403 Forbidden error means the server understood your request but has decided not to let you through. It's not a broken link (that would be a 404). It's not a server crash. The server is working fine — it's just telling you that you don't have permission to access what you're asking for.
The tricky part is that "you" might mean a legitimate user, a misconfigured script, a web crawler, or your own browser — and the fix depends on which one.
This is the most common cause on Linux web servers. If the files or directories your web server needs to read are owned by the wrong user or have permissions that block the web server process, a 403 is the result.
The web server typically runs as www-data (Ubuntu/Debian) or nginx (CentOS/RHEL). If it can't read your files, it returns 403.
Correct permissions:
# Files should be 644
sudo chmod 644 /var/www/yoursite/index.html
# Directories should be 755
sudo chmod 755 /var/www/yoursite/
# Fix ownership
sudo chown -R www-data:www-data /var/www/yoursite/
If someone accesses a directory (e.g. https://yoursite.com/images/) and there's no index.html or index.php in that directory, the server can either:
The fix is either to add an index file or ensure you're not unintentionally exposing directories.
Apache's .htaccess files can deny access to specific files, directories, or IP addresses. A misconfigured rule might be blocking legitimate requests.
Common culprits in .htaccess:
# This blocks all access to the directory
deny from all
# This restricts to specific IPs
Order deny,allow
Deny from all
Allow from 192.168.1.0/24
Review your .htaccess files, especially if the 403 appeared after a recent change.
Web application firewalls, security plugins, and server-level rules can block specific IP addresses or ranges. If your IP has been flagged (perhaps for too many failed login attempts), you'll get a 403.
WordPress: Plugins like Wordfence and iThemes Security can block IPs. Check their settings and logs.
Server-level: Check your web server config and any fail2ban or ModSecurity rules.
Some sites configure hotlink protection to prevent other sites from directly embedding their images or files. This returns a 403 when someone tries to link to a resource from a different domain. If you've recently moved domains, old hotlink rules might be blocking your own new domain.
On some server configurations, accessing a site over HTTPS when the SSL certificate isn't properly configured can result in a 403. Check your SSL setup if the 403 appears on https:// but not http://.
chmod 755 for directories, 644 for files).htaccess files in the affected directory and its parentsDirectory directives in your Apache config for Deny from all or similarNginx doesn't use .htaccess, so look in your server block config:
location /restricted {
deny all; # Remove or modify this
}
Also check autoindex — if it's off and there's no index file, Nginx returns 403.
.htaccess by going to Settings > Permalinks and clicking SaveIf you're a visitor getting a 403 on a site you should have access to:
A 403 error almost always comes down to permissions, configuration, or an access restriction rule. Start with file permissions, then check .htaccess or your server config, and work outward from there. Check your server error logs for the specific reason — the log entry for a 403 usually includes the path that was blocked, which makes diagnosis much faster.
Generative AI creates new content — text, images, code, and more. This guide explains how it works, what tools are available, and where it's genuinely useful versus overhyped.
Read moreCursor AI is an AI-powered code editor built on VS Code. Learn what it does, how it works, and whether it's the right tool for your development workflow.
Read moreClaude Opus is Anthropic's most capable AI model, built for complex reasoning and demanding tasks. Learn what it does, how it compares, and when to use it.
Read moreLooking to monitor your website and domains? Join our platform and start today.