Images not showing correctly

Aug 21, 2011 at 4:04 AM

I've just installed BlogEngine in IIS7 under a sub-folder /blog. The blog shows correctly, except for the images. Here's what a sample image looks like:

<img src="/image.axd?picture=2011%2f8%2f18-08-2011+12-40-04+PM.png" alt="" width="500px">

It really should be:

<img src="/blog/image.axd?picture=2011%2f8%2f18-08-2011+12-40-04+PM.png" alt="" width="500px">

If I go into the web.config and change this area:

<!-- You can e.g. use "~/blog/" if BlogEngine.NET is not located in the root of the application -->
<add key="BlogEngine.VirtualPath" value="~/"/>

from ~/ to ~/blog/, I get strange characters and not at all what I was expecting. How can I get the images to use the correct URL?

Aug 23, 2011 at 11:04 AM

Is the "blog" folder a standalone application ... where it has its own BIN directory, App_Code directory, etc?  Or did you merge BE with another parent application and they share the same web.config file, BIN directory, etc?

Is the URL to the blog homepage something like  ?  Or are you using some type of URL rewriting to hide the "blog" folder?

I think the BlogEngine.VirtualPath may not completely work well when it's set to something other than "~/" but I'm not entirely sure on that.

Typically though, if the blog folder is a standalone application, even with BlogEngine.VirtualPath set at "~/" BlogEngine should work and include the /blog part in the beginning of the URL.  A couple of examples where it does work are this and this, where the "blog" folder is set as an application starting point in IIS, and BlogEngine.VirtualPath is set at "~/".  So I'm thinking something may possibly not be configured right.

Aug 24, 2011 at 2:08 AM

Sorry, that was my bad. We were moving the blog from it's own top level domain to a sub-folder of another domain and didn't change the path to the images. Once they were reset everything was ok.