Umbraco - 对某些页面使用 HTTPS

发布于 2024-10-16 08:49:02 字数 423 浏览 6 评论 0 原文

我正在使用 Umbraco 构建一个网站,有几个页面需要通过 HTTPS 而不是 HTTP 进行访问(例如登录页面)。

我见过一些宏被放置在需要使用 HTTPS 的页面上,本质上只是检查所使用的协议,并在必要时使用正确的协议执行 Response.Redirect 。这似乎是实现一个相当基本的要求的糟糕方法 - 理想情况下,我希望 Umbraco 将这些页面的任何链接呈现为 ,当用户转到页面时不进行重定向。

通过这些重定向宏,如果用户位于 HTTPS 页面并导航到 HTTP 页面,浏览器还可能会显示警告。如果链接是相对的,用户将从 HTTPS 重定向到 HTTP,并且浏览器可能会对此发出警告。

有没有一种方法可以在不修改任何 Umbraco 框架代码的情况下实现这一目标?

I'm building a site with Umbraco, and there are a couple of pages that need to be visited over HTTPS instead of HTTP (e.g. a login page).

I've seen a couple of macros that get put on the page that needs to use HTTPS, and essentially just check the protocol used and do a Response.Redirect with the correct protocol if necessary. This seems like a terrible way of achieving what seems to be a fairly basic requirement - ideally I'd want Umbraco to render any links to these pages as <a href="https://...", not do a redirect when the user goes to a page.

With these redirecting macros, there's also the possibility of a browser displaying a warning if the user's on an HTTPS page and navigates to a HTTP one. If the links are relative, the user will be redirected from HTTPS to HTTP, and the browser may warn about this.

Is there a way to achieve this without modifying any Umbraco framework code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遥远的绿洲 2024-10-23 08:49:02

目前没有内置方法可以让 Umbraco 中的一些页面返回 https url。

目前我能想到的唯一方法就是确保正确设置链接。

但没有办法阻止人们进入不安全的链接。这就是重定向派上用场的地方,它将确保您不会不安全地访问安全页面。

我建议以 https 模式运行整个网站。在过去,性能一直是在 https 模式下运行完整站点的一个障碍。然而对于现代服务器来说,这真的不再是问题了。

There's currently no built-in way to make a few pages in Umbraco return a https url.

The only way I can think of doing this at the moment is just by making sure that you set up your links correctly.

But there's no way of stopping people from entering the insecure link. That is where the redirects come in handy though, it will make sure you don't get to a secure page insecurely.

I would recommend running the whole site in https mode. In the past, performance would have been an objection to running your full site in https mode. However with modern servers, this really shouldn't be a problem any more.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文