gpt4 book ai didi

SSL 和 .htaccess 强制 https

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

我从来没有这样做过

这是我当前的 .htaccess 文件,我希望它告诉浏览器切换到 HTTPS。

AddHandler php5-script .php

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?r=$1 [L,QSA]

网站JacoInc.com有 SSL 但 Chrome 会给出此消息:

The identity of this website has not been verified.
• Server's certificate does not match the URL.

不知道为什么会这样。是因为 MediaTemple 还是我正在做的事情?

最佳答案

这不是编程问题(不适用于 StackOverflow),线索在错误消息中。

您要链接到的站点的证书具有以下主题备用名称:

DNS Name: *.gridserver.com
DNS Name: gridserver.com

因此,它仅对这些名称有效(参见 RFC 6125RFC 2818 ):

If a subjectAltName extension of type dNSName is present, that MUSTbe used as the identity. Otherwise, the (most specific) Common Namefield in the Subject field of the certificate MUST be used. Althoughthe use of the Common Name is existing practice, it is deprecated andCertification Authorities are encouraged to use the dNSName instead.

Matching is performed using the matching rules specified by[RFC2459]. If more than one identity of a given type is present inthe certificate (e.g., more than one dNSName name, a match in any oneof the set is considered acceptable.) Names may contain the wildcardcharacter * which is considered to match any single domain namecomponent or component fragment. E.g., .a.com matches foo.a.com butnot bar.foo.a.com. f.com matches foo.com but not bar.com.

这与 .htaccess 无关。

作为旁注,通过重写规则从 http://https:// 的重定向只发生在 http:// 之后> 已提出请求。确保您在 https:// 上停留,不要依赖它来自动将所有链接转换为 https://

关于SSL 和 .htaccess 强制 https,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8733201/

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