任务非常简单:我需要得到 http://
网站上的链接,但我总是收到 https://
.所以,我在页面上放了这样的东西:<a href="http://link-to-my-site" rel="nofolow">Link text</a>
, 但导航到该页面时,我得到了相同的链接,但带有 https://
方案。
我确实有 Composite.Navigation.HttpsEnforcer
网站上安装的包。它不应该是这种行为的原因,但我还是删除了它 - 运气不好。
也许这是显而易见的事情,但我没有看清楚,因为现在是凌晨 4 点。
最佳答案
事实证明,这个问题根本与 Composite C1 无关。
我最近将网站的 DNS 更改为 Cloudflare,它具有“自动 HTTPS 重写”设置,这正是我在网站上遇到的情况:
Automatic HTTPS Rewrites helps fix mixed content by changing "http" to "https" for all resources or links on your web site that can be served with HTTPS.
禁用此设置解决了我的问题。
关于ssl - href 方案不断从 http 更改为 https,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40901282/