Karachi, Pakistan Mon–Sat: 10AM–7PM PKT
Home Services
Design & Development
UI/UX Design Web Development WordPress Development Responsive Web Design Corporate Website Landing Pages / Microsites E-Commerce Solutions Mobile App Development
Marketing & Growth
SEO Services Content Marketing Social Media Marketing PPC / Google Ads Branding & Creative Speed & Performance
Hosting & Support
Web Hosting Maintenance & Support
Portfolio
Website Design Logo & Graphics
Clients About Blog Free Tools Get a Quote
Hosting & Care Guide

403 Forbidden Error: Causes and How to Fix It

What a 403 Forbidden error means, how to read the error log, and fixes for permissions, .htaccess rules, missing index files, firewalls and hotlink protection.

403 Forbidden error message on a website

A 403 Forbidden error means the server understood the request but refuses to allow access. Unlike a 404, the page may exist; something is blocking it. On websites the usual causes are wrong file or folder permissions, a deny rule in .htaccess, a missing index file with directory listing turned off, a firewall or security plugin blocking your IP or request, or hotlink protection. This guide explains how to find the cause from the error and server logs, and how to fix each one without opening security holes.

Key takeaways
  • Check the server error log first; it usually names the exact reason.
  • Correct permissions are 755 for folders and 644 for files. Never use 777.
  • A firewall (ModSecurity, Imunify360, Cloudflare WAF, Wordfence) may be blocking a specific request.
  • If only one visitor sees 403, their IP or country may be blocked.

403 forbidden error: if you are a visitor

  • Check the URL for typos, especially a folder path without a file name.
  • Clear cookies for the site and reload.
  • Turn off a VPN or proxy; some sites block VPN IP ranges.
  • If it persists, the problem is on the site's side; contact the owner.

Step 1: Read the error log

In cPanel, open Metrics → Errors; in hPanel, check the logs section or the logs folder; on a VPS check /var/log/apache2/error.log or /var/log/nginx/error.log. Messages you may see: Also, this matters for 403 forbidden error on every kind of site.

Log messageMeaning
client denied by server configurationA Require all denied or Deny from rule
Permission denied: ... unable to read htaccess filePermissions or ownership are wrong
Cannot serve directory ... No matching DirectoryIndexNo index.php/index.html and listing is disabled
ModSecurity: Access denied with code 403The web application firewall blocked the request
directory index of "/path/" is forbidden (Nginx)Missing index file or wrong index directive

Fix 1: File and folder permissions

The web server must be able to read files and enter folders. Standard values:

ItemPermission
Folders755
Files644
wp-config.php or other config files440 to 640, depending on host

Fix in File Manager (select → Permissions) or over SSH:

find ~/public_html -type d -exec chmod 755 {} \;
find ~/public_html -type f -exec chmod 644 {} \;

Files uploaded as another user can also have wrong ownership. Some panels, including Hostinger, have a "Fix file ownership" tool; on a VPS use chown -R user:user ~/public_html with the correct account user.

Fix 2: Check .htaccess rules

Look for rules such as:

Require all denied
Deny from all
Order deny,allow
<FilesMatch ...> Require all denied </FilesMatch>

These are often intentional, for example blocking /data/ or wp-config.php, so remove only the rule that blocks the page you need. A quick test: rename .htaccess to .htaccess-test, reload, then rename it back. In WordPress, re-saving Settings → Permalinks rebuilds the standard rules.

Fix 3: Missing index file

If you visit a folder like /portfolio/ and it has no index.php or index.html, servers with directory listing disabled return 403. Add an index file, or link to the actual page. Do not enable directory listing on a live site; it exposes your file structure.

Fix 4: Firewalls and security plugins

  • ModSecurity / Imunify360: blocks requests that look like attacks. Contact your host with the time and URL; they can whitelist the specific rule ID instead of turning the firewall off.
  • Cloudflare: check Security → Events for the blocked request and the rule that matched.
  • Wordfence and similar: check the blocked IP list and live traffic; you may have locked yourself out after failed logins.
  • Country blocking: some sites block whole countries; make sure Pakistan is not blocked if your customers are there.

403 forbidden error: 403 on WordPress admin or uploads

  • wp-admin 403: often a security rule restricting admin by IP; your IP may have changed.
  • Saving a post gives 403: usually ModSecurity reacting to HTML or code in the content. Ask the host to whitelist that rule for /wp-admin/post.php.
  • Images 403: permissions on wp-content/uploads, or hotlink protection blocking your own domain or CDN.

Hotlink protection blocks other sites from embedding your images. If it is misconfigured, it can block your own www or non-www domain, your CDN or Google Images. Add every domain you use to the allowed list in the panel.

403 forbidden error: 403 and SEO

If Googlebot receives 403 on important pages, they drop from the index. Check Search Console's Pages report for "Blocked due to access forbidden (403)" and fix those URLs first. If your firewall blocks Googlebot, verify it is the real Googlebot by reverse DNS and allow it.

403 forbidden error: frequently asked questions

What is the difference between 401 and 403?

401 means you need to log in. 403 means you are not allowed even if you are logged in, or the server refuses for another reason.

Can a 403 be a hack?

Sometimes malware adds deny rules to .htaccess or changes permissions. If you see rules you did not add, run a malware scan; see our WordPress security guide.

Related guides: ERR_TOO_MANY_REDIRECTS, Your Connection Is Not Private Error and There Has Been a Critical Error on This Website.

For official guidance, see MDN Web Docs.

Still seeing 403?

Our support team traces 403 errors through logs, firewalls and server settings. See also our guides to 404 and 500 errors, or contact us.

Written by the ItsWebExpert team, a web design and development company in Karachi building websites, online stores and apps for businesses across Pakistan.

Ask a Question on WhatsApp

Let's Build Your
Next Website

Tell us what you need and we will reply within 24 hours with honest advice and a fixed quote.

Trusted by our clients, rated 5.0 on Google

5.0 11 Google reviews Read all →
I had a great experience working with Waqas and his team. We got some website development and SEO work done, and I'm quite satisfied with the overall results. They understood our requirements, suggested improvements, and handled the work professionally. What I appreciated most was their communication, attention to detail, and willingness to make changes whenever needed. Waqas is very cooperative, and the team knows what they're doing. Definitely a good choice for anyone looking for reliable web development and digital marketing services.
HUHafiz Ubaid Google review · Nov 2026
I was referred to their company by someone, and I'm really glad I connected with them. Waqas, the CEO, is a very humble and professional person who leads his team exceptionally well. Their expertise in digital marketing, web development, and custom development services is impressive. The team is skilled, responsive, and committed to delivering quality work. Had a really positive experience working with them. Highly recommended!
MRMuhammad Rafeeq Google review · Nov 2026
I had hired them for my client's task of Custom Wordpress plugin development. and many other tasks later on.. Waqas is super fast and sharp.. I know him since 2019.. I really really appreciate his work. Highly recommended..
RFRaheela Farooqui Google review · Nov 2026
I had a positive experience working with Waqas and his team. They provided excellent support with graphic design and social media management. The team was professional, responsive, and attentive to our needs. They understood our vision and delivered quality work on time. Highly recommended for anyone looking for creative and reliable digital services.
URUsman Rock Google review · Nov 2026
I really appreciate their dedication and professionalism. They have a good understanding of SEO, social media marketing, and online brand growth. Communication is smooth, and the quality of work is impressive. Definitely a great team to work with!
SSSameer Sarafaraz Google review · Nov 2026
I've had a great experience working with their team. They understand digital marketing very well and know how to improve online visibility through effective SEO and marketing strategies. Professional, responsive, and reliable. Highly recommended! 🙌❤️
MNMohammad naveed Google review · Nov 2026
I had a really good experience with web Experts. Everything was easy to understand, well-organized, and user-friendly. I appreciate the effort and attention to detail that has gone into creating this platform. It was a smooth and pleasant experience, and I would definitely recommend it to others. Keep up the great work!
SSShazia shaikh Google review · Nov 2026
Extremely professional and committed I am Extremely happy to work with them I wish them best of luck Best Regards M. Salman Farooqui
SFSalman Farooqui Google review · Nov 2026
Outstanding experience! Quality, professionalism, and customer service are all excellent. Keep up the great work!
ARabdul rehman Google review · Nov 2026
Excellent service and a great experience. The team is professional, helpful, and dedicated. Highly recommended!
MEmustafa emb Google review · Nov 2026