Asp.net MVC解决Http/Https [英] Asp.net MVC resolve Http/Https
问题描述
混合内容:位于< https://mywebsite/user/signin?ReturnUrl =%2f "已通过HTTPS加载,但请求了不安全的样式表" http://fonts.googleapis.com/css?family=Raleway:300,200,100 '.此请求已被阻止;该内容必须通过HTTPS提供."
"Mixed Content: The page at 'https://mywebsite/user/signin?ReturnUrl=%2f' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Raleway:300,200,100'. This request has been blocked; the content must be served over HTTPS."
在我的头部标签中,我有这些链接,
In my head tag I have these links,
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,400italic,700,800' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Raleway:100' rel='stylesheet' type='text/css'>
不是将其设置为https,而是提供一种确定http或https并动态更改这些链接的解决方案吗?,听起来像是一个非常简单的问题.
Rather than making them https, is there a solution to determine http or https and dynamically change these links?, sounds like a very simple question.
推荐答案
好吧,令人惊讶的是,答案很简单,只需删除http
Well, surprisingly the answer found to be a pretty simple one, just remove http
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,300,600,400italic,700,800' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Raleway:100' rel='stylesheet' type='text/css'>
这篇关于Asp.net MVC解决Http/Https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!