如何解决 MAMP 中外部 HD 上的 Forbidden 403

如何解决 MAMP 中外部 HD 上的 Forbidden 403

我将我的整个物理项目从 Mac 上的 HD 复制到了外部 HD,但是当我进入系统文件夹时收到 403 错误,系统文件夹内有一个名为 home 的文件夹,当它在物理硬盘驱动器内时,相同的系统没有问题:

禁止
您无权访问此服务器上的 /home/。

在系统文件夹中,我有以下内容.htaccess

RewriteEngine On

RewriteRule ^autodiscover/autodiscover.xml$ - [forbidden,last]


RewriteCond %{REQUEST_URI} !^/home
RewriteRule ^(.*)$  /home/public/v1/$1

<Files ~ "login-sistema.html$"> 
   RewriteCond %{QUERY_STRING} (loginUser|recoverUser|userCadastro)
   RewriteRule ^(.*) /home/login [forbidden,L]
</Files>


<Files ~ "\.map$">  
   RewriteRule ^(.*) /home/public/css/404.css [R=301,L]
</Files>

<IfModule mod_php5.c>
    php_flag always_populate_raw_post_data -1
    php_flag short_open_tag 1
    php_value session.auto_start 0
    php_value upload_max_filesize 280M
    php_value max_input_time 100
    php_value memory_limit 1200M
    AddType image/svg+xml svg
    AddType image/svg+xml svgz
</IfModule>


<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/map
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE image/svg+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/atom_xml
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-httpd-php
    AddOutputFilterByType DEFLATE application/x-httpd-fastphp
    AddOutputFilterByType DEFLATE application/x-httpd-eruby
    AddOutputFilterByType DEFLATE text/html

    SetOutputFilter DEFLATE

    BrowserMatch ^Mozilla/4 gzip-only-text/html

    BrowserMatch ^Mozilla/4.0[678] no-gzip

    BrowserMatch ^HMSI[E] !no-gzip !gzip-only-text/html

    SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
</IfModule>

这是一个配置文件httpd-vhosts.conf

<VirtualHost *:80>
   ServerAdmin [email protected]
   DocumentRoot "/Volumes/HD_EXTERNO/projects"
   ServerName localtest  
   ErrorLog "logs/dummy-project-error.log"
   CustomLog "logs/dummy-project-access.log" common

    <Directory "/Volumes/HD_EXTERNO/projects">
       Options Indexes FollowSymLinks Includes execCGI
       AllowOverride All
       Satisfy Any
   </Directory>
</VirtualHost>

<VirtualHost *:80>
   ServerAdmin [email protected]
   DocumentRoot "/Volumes/HD_EXTERNO/projects/sistema/"
   ServerName local.project.com.br  
   ServerAlias www.local.project.local
   ErrorLog "logs/dummy-project-error.log"
   CustomLog "logs/dummy-project-access.log" common
   php_flag always_populate_raw_post_data -1
   setEnv APPLICATION_ENV "development"
   <Directory "/Volumes/HD_EXTERNO/projects/sistema">
       Options Indexes FollowSymLinks Includes execCGI
       AllowOverride All
       Satisfy Any
   </Directory>
</VirtualHost>

<VirtualHost *:443>
   ServerAdmin [email protected]
   DocumentRoot "/Volumes/HD_EXTERNO/projects/sistema"
   ServerName local.project.com.br  
   ServerAlias www.local.project.local
   ErrorLog "logs/dummy-project-error.log"
   CustomLog "logs/dummy-project-access.log" common
   php_flag always_populate_raw_post_data -1
   setEnv APPLICATION_ENV "development"
   <Directory "/Volumes/HD_EXTERNO/projects/sistema">
       Options Indexes FollowSymLinks Includes execCGI
       AllowOverride All
       Satisfy Any
   </Directory>

</VirtualHost>

在 - 的里面文件夹中,有以下内容.htaccess

RewriteEngine On

RewriteRule ^(.*)$  /home/public/$1

在里面民众文件夹,.htaccess

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::^B$
RewriteRule ^(.*)$ - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]


Options -Indexes

“我相信这与超级用户权限有关,这样我就可以使用外部高清视频作为主机。”

相关内容