App_offline.htm,CSS,images和aspnet_isapi.dll [英] App_offline.htm, CSS, images, and aspnet_isapi.dll

查看:298
本文介绍了App_offline.htm,CSS,images和aspnet_isapi.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我工作的网站是使用urlrewriting与aspnet_isapi.dll协调(一切都映射到它)。我放了我的app_offline.htm文件,所有的文本显示,但是,CSS或图像不提供服务。我猜他们正在被ASP.NET处理,由于通配符映射而不是IIS。它是否正确?如果是这样,我如何允许IIS服务这些文件?此外,一个问题,我可以看到在web.config中的重写器设置:

 < rewrite url = ^〜/ images / network /(.*)/(.*)。jpg $to =〜/ services / ImageHandler.ashx?type = $ 1& amp; id = $ 2/> 
< rewrite url =^〜/ image / view /(.*)。jpg $to =〜/ ServePRView.aspx?id = $ 1/>
< rewrite url =^〜/ asset / view /(.*)。jpg $to =〜/ services / ImageHandler.ashx?id = $ 1& amp; type = asset/>感谢您的帮助,
-Steve




<这是因为如果网络服务器看到一个App_Offline.htm文件,它会为网站中的每个请求(即使是图像)提供该文件。您必须提供来自其他网站的图片。或者,您可以尝试类似 http://en.wikipedia.org/wiki/Data_URI_scheme


So, the site I'm working on is using urlrewriting in coordination with aspnet_isapi.dll (everything is mapped to it). I put up my app_offline.htm file, and all the text shows, however, the CSS or images aren't being served. I'm guessing they're being processed by ASP.NET due to the wildcard mapping instead of IIS. Is this correct? If so, how can I allow IIS to serve these files? Furthermore, an issue I can see arising..in the web.config for the rewriter settings:

<rewrite url="^~/images/network/(.*)/(.*).jpg$" to="~/services/ImageHandler.ashx?type=$1&amp;id=$2"/>
    <rewrite url="^~/image/view/(.*).jpg$" to="~/ServePRView.aspx?id=$1"/>
    <rewrite url="^~/asset/view/(.*).jpg$" to="~/services/ImageHandler.ashx?id=$1&amp;type=asset"/>

Thanks for the help all, -Steve

解决方案

It's because if the webserver sees an App_Offline.htm file, it serves that file for every request in the site - even images. You have to serve images from another site. Or you can try something like this http://en.wikipedia.org/wiki/Data_URI_scheme

这篇关于App_offline.htm,CSS,images和aspnet_isapi.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆