Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 asp.net mvc 网站,我希望用户在将 URL 写入此https://example.com时自动将它们转发到同一页面的 http 版本为http://example.com 可以这样做吗使用mvc路由?或者是其他东西?
在 Global.asax 文件中尝试类似的东西。
protected void Application_BeginRequest() { if (Context.Request.IsSecureConnection) Response.Redirect(Context.Request.Url.ToString().Replace("https:", "http:")); }