Pergunta

I'm trying to configure a virtual directory in IIS 7 to target the root of a website on our server. The structure for example is as follows:

Websites:
    |
    --- AssetsServer
    |    - /images/
    |    - /css/
    |    - etc.
    |
    --- demoserver
         - assets (this is my virtual directory pointing to "AssetsServer")

Now in the demoserver's html, I have the following code for an image that I want to target the images folder within "AssetsServer":

<img src="/assets/images/logos/my-logo.png" alt="My Logo">

The URL when viewed in the browser displays as:

http://www.mysite.com/assets/images/logos/my-logo.png

This looks like it should be targeting the virtual directory, which then goes into "AssetsServer"s image folder > logos > my-logo.png. However I get a 500 error and I suspect a configuration setting is wrong (maybe not wrong but not set how I need it). When I modify the virtual directory so that it points to "AssetsServer\images\" and modify the HTML code accordingly, the image displays fine.

The reason why I want the virtual directory to target the root of "AssetsServer" is so I can call the stylesheets or images without having to create multiple virtual directories to target the individual css or images folders.

I am new to ASP and if this question has been answered already, I do apologize. I've tried my best to search and my inexperience with the terms might be hindering the process.

Thank you.

Foi útil?

Solução

To troubleshot 500 errors on IIS, you need to get the substatus (for example 500.19), then check the error code, in the case of 500.19 errors (the more common), you can start here: http://blogs.iis.net/webtopics/archive/2010/03/08/troubleshooting-http-500-19-errors-in-iis-7.aspx.

If you're not getting the substatus and/or error code, then you should access the site in the server using localhost.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top