You don't have permission to access /magento/

2019-08-12 14:08发布

问题:

I've put on the host in magento in sub-folder /magento/ and when I try to open http://example.com/magento/ I got this error

Forbidden

You don't have permission to access /magento on this server.

I know is something from the .htaccess file because if I remove/rename it I can open it but I don't know what exactly can do this in .htaccess. Is someone had this problem before and can give some info how to fix it? I'll post lines that are not commented in default .htaccess

DirectoryIndex index.php
<IfModule mod_php5.c>

  php_flag magic_quotes_gpc off
  php_flag session.auto_start off

  php_flag suhosin.session.cryptua off

  php_flag zend.ze1_compatibility_mode Off

</IfModule>

<IfModule mod_security.c>

  SecFilterEngine Off
  SecFilterScanPOST Off
</IfModule>

<IfModule mod_ssl.c>
   SSLOptions StdEnvVars
</IfModule>

<IfModule mod_rewrite.c>

   Options +FollowSymLinks
   RewriteEngine on

RewriteRule ^api/rest api.php?type=rest [QSA,L]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule .* index.php [L]

</IfModule>

Order allow,deny
Allow from all

<Files RELEASE_NOTES.txt>
    order allow,deny
    deny from all
</Files>

回答1:

This looks like file permission issue. Check if your web server has the rights to read and execute on that magento folder.