How to Fix 403 Forbidden Errors

A 403 Forbidden error means the server understood your request but refuses to authorize it. This guide helps you identify and fix the common causes.

What Causes 403 Errors?

  • Incorrect file or folder permissions
  • .htaccess rules blocking access
  • ModSecurity or firewall rules
  • No index file in directory
  • IP address blocked
  • Hotlink protection

Solution 1: Fix File Permissions

Correct permissions for web hosting:

  • Folders: 755 (rwxr-xr-x)
  • Files: 644 (rw-r--r--)

Fix via cPanel File Manager:

  1. Open File Manager in cPanel
  2. Navigate to the affected file/folder
  3. Right-click and select Change Permissions
  4. Set to 755 for folders or 644 for files
  5. Click Change Permissions

Fix via SSH:

# Fix folder permissions
find /home/username/public_html -type d -exec chmod 755 {} \;

# Fix file permissions
find /home/username/public_html -type f -exec chmod 644 {} \;

Solution 2: Check .htaccess

Your .htaccess file may have rules blocking access:

  1. Open File Manager in cPanel
  2. Enable Show Hidden Files (Settings)
  3. Find .htaccess in your website directory
  4. Rename it to .htaccess_backup
  5. Test your site
  6. If working, review .htaccess rules to find the problematic one

Common blocking rules to look for:

Order Deny,Allow
Deny from all

# Or
RewriteRule .* - [F]

Solution 3: Check ModSecurity

ModSecurity may block legitimate requests:

  1. In cPanel, go to SecurityModSecurity
  2. Find the domain showing 403 errors
  3. Review recent blocked requests
  4. You can temporarily disable ModSecurity for testing
  5. If it resolves the issue, whitelist the specific rule

Solution 4: Add an Index File

If you're trying to access a directory without an index file:

  1. Create an index.html or index.php file in the directory
  2. Or enable directory listing in .htaccess:
    Options +Indexes

Solution 5: Check IP Blocking

  1. Go to cPanel → SecurityIP Blocker
  2. Check if your IP is blocked
  3. Also check .htaccess for IP deny rules:
    Deny from 123.45.67.89
    

Solution 6: Check Hotlink Protection

If images are returning 403:

  1. Go to cPanel → SecurityHotlink Protection
  2. Ensure your own domain is in the allowed URLs list
  3. Check "Allow direct requests" if appropriate

WordPress-Specific Solutions

  1. Disable security plugins - Plugins like Wordfence or iThemes Security may block access
  2. Regenerate .htaccess - Go to Settings → Permalinks → Save
  3. Check wp-config.php permissions - Should be 600 or 640

Still Getting 403?

Check your error logs for more details:

  1. cPanel → MetricsErrors
  2. Look for entries matching your 403 error
  3. The log will show exactly what triggered the error

Need Help?

Contact support with:

  • The exact URL showing the error
  • When the error started
  • Any recent changes made
  • Relevant error log entries
Bu cevap yeterince yardımcı oldu mu? 0 Bu dökümanı faydalı bulan kullanıcılar: (0 Oy)