0

I have a C# website which works fine in IIS6 & IIS7 on a company intranet but am now attempting to install the same website on a Windows XP box with IIS5 for a different part of the company intranet. The website content is fine but the css and menus are all broken, as some of the relative paths can't be found.

I am using some notation like this: <img src="Images/a.gif" which works fine, and some like this: MasterPageFile="~/App_MasterPages/Default.master" which also works fine, but the stuff like this: @import "/App_Themes/Default.css" and this: src="../App_Scripts/stringformat.js" is no good. In the code-behind Request.ApplicationPath is also missing the "/" off the end.

I tried unticking the "Enable Parent Path" in IIS and did an iisreset but it made no difference. I also tried installing IIS Developer Express, but that was confusing and sucked too much. I don't want to have to go through the whole application and change every relative path just to support IIS5 format, but is that my only option? (apart from upgrading Windows)

JumpingJezza
  • 5,498
  • 11
  • 67
  • 106

1 Answers1

0

I suspect that on IIS6 & 7 the application in question is being deployed into the site root and that on XP/IIS5.1 you've deployed this into a sub folder running as an IIS application.

You have two options:

  1. Deploy the site into the IIS5.1 root (c:\inetpub\wwwroot).

  2. Fix the absolute paths and make them application relative i.e. @import /App_Themes.

  3. Persevere with IIS Developer Express, it's not that sucky.

Kev
  • 118,037
  • 53
  • 300
  • 385
  • Both sites are deployed into `inetpub\wwwroot` so that is not the issue. I'm not that keen on point 2 either as there are a lot of links to update, and could break it for IIS6/7? IIS Express was unintelligible and I can't see how to run a website the usual way. There were so many questions I had that wasn't answered by microsofts documentation. Do I have to uninstall IIS5 for example? – JumpingJezza Dec 06 '10 at 00:09
  • @jumpingjezza - You say "both sites"? Can you update your answer to give us some idea of your folder structure? – Kev Dec 06 '10 at 00:44
  • both sites meaning the same website set up on different servers in different intranets – JumpingJezza Dec 06 '10 at 01:02
  • no-one came up with a better idea, so I'll mark you correct for point 2: Find and fix ALL the path references – JumpingJezza Dec 09 '10 at 02:25