Wordpress 显示在错误的 cPanel 帐户上
Wordpress showing up on the wrong cPanel account
在 cPanel 上,我有 2 个帐户 - 我可以将它们加载到浏览器中,如下所示 URLS(IP 地址是虚构的):
https://11.22.33.44/~staticSite
https://11.22.33.44/~wordpressSite
~staticSite
只是 .php 文件的集合,没有数据库。这些文件之一(例如)是 index.php
.
~wordpressSite
是一个标准的 WordPress 站点(版本 5.2.4)。
问题是,每当我加载 ~staticSite
时,我都会从加载了 404/Oops! That page can’t be found.
消息的 ~wordpressSite
中获取主题。
即使我尝试直接加载 https://11.22.33.44/~staticSite/index.php
,index.php
也会被删除,我最终会看到 404 页面,就好像我在 ~wordpressSite
上一样 - 但是地址在URL 仍然是 https://11.22.33.44/~staticSite/
为了尝试解决这个问题,我已经通过 cPanel 完全终止了 ~staticSite
帐户。然后我重新创建了它(使用相同的名称,只是一组不同的 passwords/FTP 详细信息)然后将文件重新上传到这个新的 ~staticSite
- 但问题仍然存在 - 就好像 ~wordpressSite
泄漏到一个完全不同的帐户。
还没有域或 DNS 指向 ~staticSite
帐户。但是 ~wordpressSite
有一个域指向它并为其设置了 SSL 证书。
~staticSite
上的 .htaccess
文件内容如下:
RewriteEngine On
# The following redirects .co.uk to .com
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?staticsite\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://www.staticsite.com/ [R=301,L]
# The following forces a redirect to HTTPS instead of HTTP
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
此问题是由 SSL 证书和此 .htaccess
文件的内容共同引起的吗?我不确定是不是,为了检查我刚刚完全删除了 .htaccess
文件,问题仍然存在。
有人可以帮忙吗?我希望我提供了足够的信息 - 如果我没有提供请询问。
我刚刚找到我记得几年前读过的对话:
https://forums.cpanel.net/threads/https-site-name-here-redirects-to-a-different-site.395002/
来自link:
"If the account is assigned a shared IP address, and a SSL certificate is installed on that IP address, then any secure request to a domain name on that IP address will load the contents of the domain name the certificate is installed for. This is by design. [emphasis mine] You will need to assign a dedicated IP address to the account that uses the SSL certificate if you don't want that certificate applied to the other domain names on it's IP address."
在 cPanel 上,我有 2 个帐户 - 我可以将它们加载到浏览器中,如下所示 URLS(IP 地址是虚构的):
https://11.22.33.44/~staticSite
https://11.22.33.44/~wordpressSite
~staticSite
只是 .php 文件的集合,没有数据库。这些文件之一(例如)是 index.php
.
~wordpressSite
是一个标准的 WordPress 站点(版本 5.2.4)。
问题是,每当我加载 ~staticSite
时,我都会从加载了 404/Oops! That page can’t be found.
消息的 ~wordpressSite
中获取主题。
即使我尝试直接加载 https://11.22.33.44/~staticSite/index.php
,index.php
也会被删除,我最终会看到 404 页面,就好像我在 ~wordpressSite
上一样 - 但是地址在URL 仍然是 https://11.22.33.44/~staticSite/
为了尝试解决这个问题,我已经通过 cPanel 完全终止了 ~staticSite
帐户。然后我重新创建了它(使用相同的名称,只是一组不同的 passwords/FTP 详细信息)然后将文件重新上传到这个新的 ~staticSite
- 但问题仍然存在 - 就好像 ~wordpressSite
泄漏到一个完全不同的帐户。
还没有域或 DNS 指向 ~staticSite
帐户。但是 ~wordpressSite
有一个域指向它并为其设置了 SSL 证书。
~staticSite
上的 .htaccess
文件内容如下:
RewriteEngine On
# The following redirects .co.uk to .com
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?staticsite\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://www.staticsite.com/ [R=301,L]
# The following forces a redirect to HTTPS instead of HTTP
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
此问题是由 SSL 证书和此 .htaccess
文件的内容共同引起的吗?我不确定是不是,为了检查我刚刚完全删除了 .htaccess
文件,问题仍然存在。
有人可以帮忙吗?我希望我提供了足够的信息 - 如果我没有提供请询问。
我刚刚找到我记得几年前读过的对话:
https://forums.cpanel.net/threads/https-site-name-here-redirects-to-a-different-site.395002/
来自link:
"If the account is assigned a shared IP address, and a SSL certificate is installed on that IP address, then any secure request to a domain name on that IP address will load the contents of the domain name the certificate is installed for. This is by design. [emphasis mine] You will need to assign a dedicated IP address to the account that uses the SSL certificate if you don't want that certificate applied to the other domain names on it's IP address."