我在寻找获得浏览器的快捷,方便和可靠的方式HTTP推荐在ASP.Net(C# ).我知道HTTP推荐本身是不可靠的,但我确实希望得到引荐,如果它的可靠方法是存在.
我在IIS7(Vista)上使用带有.NET 3.5的ASP.net和Microsoft的URL重写模块.
这意味着,我有一个
<system.webServer>
<rewrite>...</rewrite>
...
</system.webServer>
Run Code Online (Sandbox Code Playgroud)
web.config中的部分,但我得到一个警告,在system.webServer中,不允许使用元素"rewrite".
如何配置我的系统允许(甚至可能有Intellisense)在web.config的重写部分?
谢谢Christoph
目前我正在尝试获取浏览器中显示的当前 URL。
如果我使用
Request.Path
Run Code Online (Sandbox Code Playgroud)
我得到https://this.website.com:443/Default.aspx,这在技术上是正确的。
但是浏览器本身显示的 URL 是https://this.website.com/。
使用任何请求选项仍将显示 Default.aspx。
我需要最终检测浏览器中的 url 是否为https://this.website.com或http://this.website.com/Default.aspx,然后重定向到 Default.aspx(如果不存在)。
顺便说一句,更复杂的是我的 web.config 中的 https 重定向。
asp.net ×3
c# ×2
url ×2
http ×1
http-headers ×1
http-referer ×1
module ×1
request ×1
rewrite ×1
web-config ×1