【问题标题】:Wordpress Multisite Https Forbidden ErrorWordpress 多站点 HTTPS 禁止错误
【发布时间】:2019-11-25 01:24:59
【问题描述】:

我承诺使用 wordpress 多站点。该网站可以通过http从局域网访问,但不能使用https。

我现在的目标是将网站发布到互联网上。我有反向代理和 DNS 服务器,但我很确定,问题不在于它们。

以下是错误:

Access forbidden!
        You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

        If you think this is a server error, please contact the webmaster.

        Error 403
        ddmc.co.id
        Apache/2.4.39 (Win64) OpenSSL/1.1.1b PHP/7.3.4

这是当前配置:

WP_2_OPTION

siteurl: http://ddmc.co.id/id
home: http://ddmc.co.id/id

WP_SITE

domain: ddmc.co.id
path: /

WP_SITEMETA

siteurl: http://ddmc.co.id

WP_BLOGS

domain: ddmc.co.id path:/
domain: ddmc.co.id path:/id/

WP_OPTION

domain: http://ddmc.co.id path:/
domain: http://ddmc.co.id path:/id/

wp-config.php

define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'ddmc.co.id');
define('PATH_CURRENT_SITE','/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT', 1);
define('WP_MEMORY_LIMIT', '512M');

htaccess

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

# END WordPress

htpd-vhosts

<Directory "c:/xampp/htdocs/ddmc">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order Deny,Allow
        Allow from all
        Require all granted
</Directory>

我已经解决了一个星期没有成功,请帮助。

【问题讨论】:

  • Apache 通常将 HTTPS 视为端口 443 上的单独虚拟主机。您设置了吗?我会尝试显式地转到 /index.php 以检查重写规则或 CGI 设置是否存在问题。您也可以尝试在后台运行 procmon 以准确检查它正在为 SSL 案例读取哪个文件夹。
  • 还没有(我会尝试),我是否应该创建 csr 并安装 .cer 以进行考试,因为我已经在反向代理上安装了证书。你能解释一下关于检查 index.php 重写规则的更多信息吗?我会尝试安装 procmon。
  • 我刚刚意识到我有另一个 xampp Web 服务器,在虚拟主机上配置了端口 80,并且使用反向代理正常运行。
  • 我尝试使用具有相同 DNS 和反向代理配置的另一个网站(不同的 IP、服务器)。它的作品!所以我认为问题是因为 wordpress 多站点。 phpmyadmin 和 wp_config 中有很多 URL 配置。

标签: wordpress


【解决方案1】:
<Directory "c:/xampp/htdocs/hcml">

hcml 是不是打错字了?基本上不知何故你的路线是错误的,或者你的文件权限是由Apache 用户读取WordPress 文件夹。

【讨论】:

  • 应该是ddmc,只是错字。我不确定 Windows 中的文件夹权限,我只是使用默认的 htaccess wordpress 多站点。
【解决方案2】:

我刚刚发现了问题。

问题是在我将 httpd.conf 下的目录从 htdocs 更改为我的网站文件夹之后。

<Directory "C:/xampp/htdocs/">

改为:

<Directory "C:/xampp/htdocs/ddmc">

现在的问题是,您的网站重定向到仪表板。如何更改文档根目录而不会出现错误禁止访问?

【讨论】:

    猜你喜欢
    • 2014-10-13
    • 2015-01-21
    • 2016-06-17
    • 2015-07-14
    • 2013-07-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多