2

I am working on getting a website up and running which was design by someone else, but I am running into a bizarre issue I have never seen before.

Throughout the website, all file paths are relative, so for instance, all img tags have an src like src='i/image.png'. The same is true for css link tags, script tags, etc. This is quite normal, and I have never had any issues with this in the past.

The problem is that when some people access the site with their browser, none of these resources are loading, but for others the site loads just fine. After examining the page on one of the computers it is not working on, I see the URL for images are http://i/image.png, while on the working computers it is http://mydomain.com/i/image.png.

Any explanation for this? Why would some computers (all using IE) fail to add the domain, while others work correctly? We are behind a proxy here at work, if that is a possible culprit, as I have yet to see the site load incorrectly from outside our network. Also, site is using doctype of XHTML 1.0 Transitional.

tjc59
  • 613
  • 7
  • 24
  • Try different browsers on your own machine - IE9 is really good in that it can emulate IE7 and 8. – Anders Arpi Aug 10 '12 at 14:01
  • Which is the server side language? Maybe in server code it is finding the domain name dynamically and appending before the image src. Since no domain name can be found its outputting as http://i/image.png – kiranvj Aug 10 '12 at 14:01
  • Both. As I said in my post, it is happening on img tags, css link tags, and script tags. I forgot to mention it in my post, but it is also happening with images referenced in the css (background-image). Basically all that loads is plain text, and nothing else. No css loads, no images load; nothing. – tjc59 Aug 10 '12 at 14:03
  • On my PC, I've tried it using IE8, Chrome, Safari, Opera, and Firefox, and it loads correctly every time. I also tried it from outside our network with these same browsers, and had no issues. On the PCs it did not work on, they were using either IE9 or IE8, depending on the OS they were running. – tjc59 Aug 10 '12 at 14:04
  • It is an ASPX page, with C# as the server side language, but it does not touch any of the elements that are not loading (the CSS link tags, img tags, etc. are all in the markup, not the code behind). – tjc59 Aug 10 '12 at 14:07

1 Answers1

2

Ok, I think I have found the answer. It seems that in IE, in the Compatibility View Settings, the 'Display intranet sites in Compatibility View' is checked by default. So anyone inside our network that accesses the website is forced into Compatibility View, which messes up all those paths for images, css and scripts. Anyone outside the network who accesses the website it will work for, unless they are explicitly turning on Compatibility View.

On another Stack Overflow thread, I found a hack that, as far as I can tell, always prevents Compatibility View from being enabled for the site.

Community
  • 1
  • 1
tjc59
  • 613
  • 7
  • 24