gpt4 book ai didi

php - 如何将 https 请求重定向到 https::www

转载 作者:太空宇宙 更新时间:2023-11-03 14:57:13 25 4
gpt4 key购买 nike

我在 GoDaddy 上购买了一个主机账户并将其命名为 dev.anotherwebsite.com
然后我带来了一个名为 www.website.com
的新域托管帐户上的目录结构如下。

public_html
--------网站文件夹
-------------- 应用程序文件/文件夹。
-------------- ssl.key
-------------- .htaccess

Websitefolder 包含 www.website.com

的所有文件

我已将我的域 www.website.com 转发到文件结构中的网站文件夹。所以现在请求是从 dev.anotherwebsite.com 到 website.com 的,因此,当我键入 website.com 时,浏览器无法验证请求实际上是去 www.website.com 因为它将请求重定向dev.anotherwebsite.com 到 website.com

顺便说一句,www.website.com 不是子域。

我在 Websitefolder 上安装了 ssl 证书并尝试浏览我的网站。 https://website.com/工作正常!但是当我尝试浏览 https://www.website.com/它抛出一个错误

This Connection is Untrusted

You have asked Firefox to connect securely to www.99anchors.com, but we can't confirm that your connection is secure.

Normally, when you try to connect securely, sites will present trusted identification to prove that you are going to the right place. However, this site's identity can't be verified. What Should I Do?

If you usually connect to this site without problems, this error could mean that someone is trying to impersonate the site, and you shouldn't continue.

.htaccess 内容如下

Options +FollowSymLinks
IndexIgnore */*
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [L]
</IfModule>

问题!我不确定这是否与 .htaccess 或将 ssl key 放在根文件夹中有关?或为 dev.anotherwebsite.com

生成新 key

最佳答案

您的 SSL 证书类型是什么?它是通配符 SSL 吗?

在您的 .htaccess 文件中尝试这些规则:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

关于php - 如何将 https 请求重定向到 https::www,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27768458/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com