【问题标题】:folder public access with htaccess使用 htaccess 的文件夹公共访问
【发布时间】:2017-06-16 08:42:35
【问题描述】:

我真的不是.htaccess 的专家,我可以远程访问托管已经运行的php 网站的apache 服务器。我想创建一个data 文件夹并授予它公共访问权限。现在,当我运行 http://thewebsite.com/data 时出现 403 错误。我检查了没有问题的权限,我推断这个错误一定与.htaccess有关

Options -Indexes
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]  

有没有办法通过一些 .htacess 规则来解决这个 403 错误?

【问题讨论】:

    标签: php apache .htaccess permissions http-status-code-403


    【解决方案1】:

    我认为您正在寻找 &lt;directory&gt; 指令,例如:

    <Directory "path/to/data">
        Allow from all
    </Directory>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-23
      • 1970-01-01
      • 2020-12-24
      • 2021-11-26
      • 1970-01-01
      • 1970-01-01
      • 2012-08-08
      • 1970-01-01
      相关资源
      最近更新 更多