开发者

Images in app_offline file

开发者 https://www.devze.com 2023-03-09 23:12 出处:网络
Is there a way to use an image with an app_offline file? I\'d like to keep the app_offline looking like the rest of the website - same header, etc, which includes an image.

Is there a way to use an image with an app_offline file? I'd like to keep the app_offline looking like the rest of the website - same header, etc, which includes an image.

I did try finding a way to do this but I can't seem to do so. The for开发者_StackOverflowum posts that I've ran across say it's not possible, since the app_offline forces all requests (even those for images and css) to redirect to the app_offline page, but I'm hoping that someone here will have an answer. Obviously, I can embed the css into the HTML, rather than pointing to the site's .css file, but I'm not sure how to get around the image issue.


You could try base64 encoding the image, ie.

<img src="data:image/gif;base64,BASE64STRINGHERE" width="80" height="15" />

The reason you need to do it like this is that IIS sees the image as a request and app_offline.htm being present in the root is telling IIS to redirect ALL requests therefore this includes any MIME types from images to music etc

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号