相关疑难解决方法(0)

为什么要使用协议相对URL?

这是StackOverflow上经常讨论的问题,这意味着什么:

 <script src="//cdn.example.com/somewhere/something.js"></script>
Run Code Online (Sandbox Code Playgroud)

这样做的好处是,如果您通过HTTPS访问它,您将自动获得HTTPS,而不是那个可怕的"此页面上的不安全元素"警告.

但为什么要使用协议相对的URL呢?为什么不直接在CDN URL中使用HTTPS?毕竟,如果您决定通过HTTPS加载某些部分,HTTP页面没有理由抱怨.

(这更适用于CDN;几乎所有CDN都具有HTTPS功能.而您自己的服务器可能不一定具有HTTPS.)

html https http cdn relative-url

27
推荐指数
2
解决办法
1万
查看次数

混合内容/不安全内容SSL

我目前有以下问题

Mixed Content: The page at 'https://www.example.com/' was loaded over HTTPS, but requested an insecure stylesheet
Run Code Online (Sandbox Code Playgroud)

这是httpd安装了Centos服务器上的Wordpress网站。

我在`http.conf中有以下虚拟主机设置:

NameVirtualHost *:80
NameVirtualHost *:443


<VirtualHost *:443>
    DocumentRoot /var/www/html/example
    ServerName www.example.com
    ServerAlias example.com
    SSLEngine on
    SSLCACertificateFile /etc/httpd/conf/ssl.crt/intermediate.crt
    SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
    SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
</VirtualHost>

<VirtualHost *:80>
    ServerName www.example.com
    ServerAlias example.com
    Redirect / https://www.example.com/
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

在我这里,httpd.conf我改变AllowOverride了所有,所以看起来像这样:

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
Run Code Online (Sandbox Code Playgroud)

我可以确认htaccess正在使用iTheme安全插件,并且可以正常运行,如果在“我”中输入了一些垃圾,也会htacces收到服务器配置错误。

我已经更改了仪表板中的两个Wordpress URL来https代替http。 …

apache wordpress .htaccess ssl mixed-content

2
推荐指数
1
解决办法
2060
查看次数

标签 统计

.htaccess ×1

apache ×1

cdn ×1

html ×1

http ×1

https ×1

mixed-content ×1

relative-url ×1

ssl ×1

wordpress ×1