【问题标题】:403 Forbidden, when uploading site to drupal403 Forbidden,在将网站上传到 drupal 时
【发布时间】:2016-03-27 12:36:18
【问题描述】:

我在 Azure 上使用 Drupal 托管了虚拟机。

drupal/htdocs/sites 中,我创建了名为my-site.com 的新文件夹

然后我已将所有网站数据上传到此文件夹。它们是default.settings.phpsettings.phpfiles 文件夹。

我已经通过 phpMyAdmin 上传了我的数据库,并在 settings.php 中设置了正确的登录名和密码

当我尝试通过此网址打开此网站时:http://my.ip.address/sites/my-site.com 它显示一条错误消息:

Forbidden

You don't have permission to access /sites/my-site.com/ on this server.

我的 htaccess 文件有以下几行:

# Turn off all options we don't need.
Options None
Options +FollowSymLinks

# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
# Override the handler again if we're run later in the evaluation list.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>

# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
  php_flag engine off
</IfModule>

我做错了什么?

【问题讨论】:

    标签: php .htaccess azure drupal drupal-7


    【解决方案1】:

    根据http://planken.org/2013/11/drupal-724-htaccess-modifications-private-and-temp-folders的帖子,看来你.htaccess文件中的内容是为了保护代码和文件,防止目录中的代码执行。

    要在子目录下运行完整的Drupal应用程序,可以尝试将根目录下原来的.htaccess文件复制到子目录下。

    您可以在https://github.com/drupal/drupal/blob/8.1.x/.htaccess 获取示例.htaccess 文件

    【讨论】:

      【解决方案2】:

      您应该首先检查您网站的 docroot 中是否有一个 .htaccess 文件。有时当您复制站点时,docroot 中的隐藏文件会被忽略。以下命令将复制丢失的隐藏文件:

      cp source/.* destination/
      

      您发布的 .htaccess 位于您的文件目录中,这不是我们在尝试通过 index.php 访问网站时关心的主要 .htaccess

      【讨论】:

        猜你喜欢
        • 2017-06-04
        • 2019-12-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-12-23
        • 2022-08-02
        • 2022-12-19
        • 1970-01-01
        相关资源
        最近更新 更多