Coolest Guides on the Planet

coolest guides on the planet

Coolest Guides On The Planet

  • Home
  • macOS
  • WebDev
  • All Posts
  • Contact

Fix 403 Forbidden Error, WordPress, .htaccess

June 28, 2011 22 Comments

Forbidden 403 Error
You don’t have permission to access /~username/blahblahblah on this server.

403-htaccess-forbidden-wordpress

403-htaccess-forbidden-wordpress

When you customise WordPress to have custom permalinks, WordPress needs to make rewrites to clean URLs and produce a ‘.htaccess‘ file in the root directory of the webserver installation, sometimes the “.htaccess” rewrite composition isn’t the best and produces a 403 Forbidden error for the entire site, basically eventhough the ‘.htaccess’ has the right permissions the webserver is not explicitly allowing the rewrites for that directory.

To temporarily get out of the jam, just disable the ‘.htaccess’ file. You can rename it ‘htaccess.txt’
But to fix the issue properly and use your .htaccess file you need to add additional directives at the head of the file.

Once you get the error – first thing to check is the apache webserver error log. Depending on your OS it has a different location; on Mac OS X  it’s in /var/log/apache2/error_log, on most Linux boxes it’s in /var/log/httpd/error_log

If the error is similar to:

[Tue Jun 28 18:21:48 2011] [error] [client ::1] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden:

Then add “Options +FollowSymLinks”  to your .htaccess file  at start of the file:

Options +FollowSymLinks
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Now the 403 should be no more.

Cats: macOS, Open Source, WordPress Tags: 403, error, htaccess, options, symlinks

Tags

3gs 10.6 apache backup baseband boot clean urls cpanel css curl custom database drupal el capitan git Google image instadmg ios iphone jailbreak keys lion mac macos mojave macos sierra menu mysql OSX panda php phpmyadmin private public redirect redsn0w remote rsa SEO shell ssh terminal unstoppables upgrade urls

Donate a Beer to the Coolest Guides

Get Beaver Builder Now!

Copyright © 2023· Neil Gee - All Rights Reserved - Hosted by Runcloud

Copyright © 2023 · gee on Genesis Framework · WordPress · Log in