Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

strange issue with publishing website (the images don't show up after publishing)

I developed a website in ASP.Net 3.5. When I compile it with Visual Studio on the HOST Machine, the website shows up correctly! But when I publish the website to the host machine's website hosting folder, type the navigate to the site in the IE, it shows up this way:

  1. the images do not show up
  2. fonts are not recognized

Does anyone have any idea what could be the issue?!

I mean the same Host Machine! Same IE (version8)! Compiling it with Visual Studio 2008 on that machine, every thing is fine, but when calling the published site on the same host machine by typing the URL in IE, the images don't show up and the fonts are not recognized.

like image 967
gwt Avatar asked Jan 28 '26 11:01

gwt


1 Answers

Images/fonts not showing up is a sign that your relative paths are off. One common cause of this is forgetting to creating the IIS application when you deploy. If you don't create the application, then image paths written like this:

~/content/images/img1.jpg

will be broken. (They'll resolve to mydomain.com/content/images/img1.jpg instead mydomain.com/myapplication/content/images/img1.jpg.)

Another possibility is that your relative paths are written like this:

/content/images/img1.jpg

This type of link will always be broken if you deploy to any sub-path within a domain. Ie, if you deploy to mydomain.com then the links will be good, but if you deploy to mydomain.com/myapplication, then URLs written like the above will resolve incorrectly as mydomain.com/content/images/img1.jpg.

like image 153
McGarnagle Avatar answered Jan 31 '26 03:01

McGarnagle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!