Website not displaying images/css stylesheets, etc.

I have a website that uses stylesheets, bootstrap and normal images.
Installed it on a win 8 machine (IIS 7), the page opens but no image or stylesheet is displayed, so the site only displays text.

What could cause this to happen ?  The same files installed on a different server display just fine. Maybe an IIS setting ?
LVL 1
AleksAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Make sure you have your paths correct to these things correctly set.  If your code looks like below, it's possible your root path is different locally vs on the server.  

<!DOCTYPE html>
<html>
<head>
<script src="/jquery.min.js"></script>
<link href="/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="/js/bootstrap.min.js"></script>
  <meta charset="utf-8">
  <title>test</title>
</head>
<body>
<img src="/images/someimages.jpg">
</body>
</html>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Julian HansenCommented:
Can you post the source for the page?
0
AleksAuthor Commented:
Unfortunately I can't post the source and the problem is not with the source code since it is the exact same as the one installed on another computer in which it works just fine.  So ASP code is exactly the same, the paths are correct.

It has to be something in the computer (IIS) or otherwise blocking the stylesheets and images.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
What you will need to do is create a test case http://sscce.org/ with only sample data you can share and try and reproduce what is happening.  Replace items that come from a database with static data or make an array in asp.  Many times, just doing this forces  you to trouble shoot without even knowing it.  

You can also make sure the file types are allowed in iis.  http://www.iis.net/configreference/system.webserver/security/requestfiltering/fileextensions


I would start with this file as is for your test case.
<!DOCTYPE html>
<html>
<head>
  <style>
  /* save this portion as a css file */
    .red{font-size:150%;color:red;}
  </style>
  <meta charset="utf-8">
  <title>testing</title>
</head>
<body>
  <div>I am normal text and <span class="red">I am red text</span></div>
<img src="http://experts.cachefly.net/files/2013/12/23/12bc0b3f-c4b7-45cd-889e-a45e0b37e769.jpg">
</body>
</html>

Open in new window

Then

<!DOCTYPE html>
<html>
<head>
<!-- 
remove the style tags from the first example and place that code in a file called style.css and place it in the same folder as this test file.
-->
<link href="style.css" rel="stylesheet" type="text/css" />
  <meta charset="utf-8">
  <title>testing</title>
</head>
<body>
  <div>I am normal text and <span class="red">I am red text</span></div>
<!-- 
either save the image as test.jpg in place it in the same folder as this file or use your own image
-->
<img src="test.jpg">
</body>
</html>

Open in new window


Try both of these files and see what happens.  Make sure to make a css file and test.jpg (or if you use a different file, update the name).  If the 2nd file still is not loading when you place the external files in the same folder as the html file, then you probably do have to add the mime types to iis.
0
Julian HansenCommented:
"Unfortunately I can't post the source and the problem"
Any particular reason why not - all we need to see is the <head> section - and yes it is relevant because you could have a situation where your head refers to a style sheet with an absolute path like so

<link href="/css/somestylesheet.css" >

And you are running off a sub-folder

OR

Your code has a <base href=""> statement in it.

There are a number of conditions where the same page will work in one place but not another and it not have anything to do with the server but to the way the page is coded.

Without source we are just guessing.
0
AleksAuthor Commented:
The code is the same as the one on another laptop and the other works fine, hence it is NOT the code.
There is some setting in IIS or windows preventing from showing images or css in one of the computers.  I just can't find where it is.
0
AleksAuthor Commented:
And the above code did not display images.
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
>And the above code did not display images.

Looks good to me http://jsbin.com/jejihu/1/edit
What happens if you just copy and paste this to the machine that is not working as an html file and load it?
<!DOCTYPE html>
<html>
<head>
  <style>
  /* save this portion as a css file */
    .red{font-size:150%;color:red;}
  </style>
  <meta charset="utf-8">
  <title>testing</title>
</head>
<body>
  <div>I am normal text and <span class="red">I am red text</span></div>
<img src="http://mancan.beer/wp-content/uploads/2015/03/mancan-family-barrel-kickstarter-1170x686.jpg">
</body>
</html>

Open in new window


While there is a chance it is iis, there is an even better chance it actually is the code.  Running local vs a web server has it's own issues as well and it could be the domain/file structure.

If you are still convinced that it is iis, look at your logs.  As pointed out, make sure the file types are set. Make sure the files are in a public folder and accessible.  

All the browsers have a console, check for errors such as 404's https://developer.chrome.com/devtools/docs/console
https://msdn.microsoft.com/en-us/library/gg589530%28v=vs.85%29.aspx
https://developer.mozilla.org/en-US/docs/Tools/Web_Console
0
Julian HansenCommented:
Have you checked your MIME types on IIS to ensure that the image types are set for the images you are serving.
0
AleksAuthor Commented:
Well ... they are simple gif images. Ill check but I would think those are usually added automatically
0
Julian HansenCommented:
Well ... they are simple gif images. Ill check but I would think those are usually added automatically
Given how little we have been given to go on - we are going to have to do it the plodding way.

Can you browse the images directly?

Can you browse html files in the same folder as the images?
0
AleksAuthor Commented:
Some features were not installed on IIS  ... sigh ! .. problem solved. Thanks for the help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.