Try putting this into your .htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/cgi-bin(/.*)?$ [OR]
RewriteCond %{SCRIPT_FILENAME} -f [OR]
RewriteCond %{SCRIPT_FILENAME} -d
RewriteRule .* - [PT,L]
RewriteRule ^([a-zA-Z0-9-]+)/?$ /index.php [L]
RewriteRule ^([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/?$ /index.php [L]
</IfModule>
# END WordPress
This code actually didn’t help me – I’m still getting 404 file not found even when I don’t use pretty permalinks – and the permissions are fine. I can’t even access cgi-bin if I completely delete the .htaccess file. so I don’t know what’s going on.