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.
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.