ASP.NET使用RewritePath重定向后,服务器响应的HTTP头会多个Content-Location:
复制代码 代码如下:
HTTP/1.1 200 OKContent-Length: 48150Content-Type: image/jpegContent-Location: http://www.mzwu.com/test.jpgLast-Modified: Tue, 18 Dec 2012 15:01:50 GMTAccept-Ranges: bytesETag: "e119ee9b30ddcd1:1c48"Server: Microsoft-IIS/6.0X-Powered-By: ASP.NETDate: Mon, 08 Sep 2014 01:29:40 GMTContent-Location值为重定向文件的真实路径,在一些场合下我们不想让客户端知道这个路径,有办法去掉它吗?去不掉,但可以手工在IIS中给网站设置一个同名HTTP头借以隐藏真实路径:
现在效果如下
复制代码 代码如下:
HTTP/1.1 200 OKContent-Length: 48150Content-Type: image/jpegContent-Location: mzwu.comLast-Modified: Tue, 18 Dec 2012 15:01:50 GMTAccept-Ranges: bytesETag: "e119ee9b30ddcd1:1c58"Server: Microsoft-IIS/6.0X-Powered-By: ASP.NETDate: Mon, 08 Sep 2014 01:42:50 GMT新闻热点
疑难解答