IIS URL 重写 - 源文件是否已经存在?
似乎以前已经有人问过这个问题,但我对这个问题有疑问。
我有一个 Mosso / RackSpace Cloud 站点,我正在尝试将入站 PDF 请求(例如 site.com/abc.pdf)重定向到 pdf 处理程序页面,该页面将通过 BinaryWrite 从 App_Data 为它们提供服务。
他们在 http://www.wip.rackspacecloud.com/ 有一个示例knowledge_center/index.php/How_do_I_rewrite_URLs_from_ASP.NET 显示了如何执行此操作,我已经尝试过,但它不提供文件除非原始文件存在。
Mosso / RackSpace Cloud 告诉我,仅当原始文件存在时才会发生文件重定向。
是否需要存在原始文件才能进行重写(如示例所示)?
IIS Express 7.5 下的本地测试表明不需要。也许 Mosso 以某种方式配置了奇怪的管道,以便 IIS 首先运行。我想我被欺骗了。
It may seem like this has been asked before, but I have a wrinkle to this question.
I have a Mosso / RackSpace Cloud site that I am trying to redirect inbound PDF requests such as site.com/abc.pdf to a pdf handler page that will serve them up from App_Data via a BinaryWrite.
They have a sample at http://www.wip.rackspacecloud.com/knowledge_center/index.php/How_do_I_rewrite_URLs_from_ASP.NET that shows how to do this, I have tried it and it does not serve files UNLESS the original file exists.
I am being told by Mosso / RackSpace Cloud that file redirection only occurs when the original file exists.
Does the original file need to exist for a rewrite (as shown in the example) to work?
Local testing under IIS Express 7.5 says not. Perhaps Mosso have the pipeline configured odd somehow so that IIS runs first. I think I am being fobbed off.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果这是 IIS 重定向,则在尝试将甜甜圈分发给您的朋友之前,它不会检查您是否确实购买了这些甜甜圈。在 ASP.NET 中重写代码也是如此。而且,考虑到 HTTP“宣言”,它不应该在意,因为有一个称为 404 的概念。不确定云是如何设置的,因此可能存在一些您必须处理的限制,但这应该很容易足以进行 bozo 和冒烟测试。
If this is IIS redirect, it does not check to see if you actually bought the donuts before trying to hand them out to your friends. Same is true with rewriting in code in ASP.NET. And, considering the HTTP "manifesto" it should not care, as there is a concept called a 404. Not sure how the cloud is set up, so there may be some restrictions there that you have to deal with, but it should be easy enough to bozo and smoke test.