Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • rakesh khoodeeram 6 posts 76 karma points
    May 03, 2017 @ 11:50
    rakesh khoodeeram
    0

    Relative path of css and js files missing application name. 404 not found

    Hello, I added Umbraco to an MVC application on VS 2015. When I launched the app using IISExpress, the umbraco home page is displayed correctly (js, css, images loaded). But when I deployed to local IIS, the home page is loaded but the files (js, css, images) are not loaded since the links generated are like: /css/fanoe.css /css/style.css background-image:url(/media/1050/nccbg2.jpg) /js/jquery.min.js when I inspect the code and add the absolute path, everything loads correctly.

    some links are generated correctly The starter kit

    How do I fix the links for the js/css/images?

  • Alex Skrypnyk 6133 posts 23952 karma points MVP 7x admin c-trib
    May 05, 2017 @ 10:35
    Alex Skrypnyk
    0

    Hi Rakesh

    Links like: /css/fanoe.css /css/style.css background-image:url(/media/1050/nccbg2.jpg) /js/jquery.min.js looks right, it should work.

    Do you have access to this files on the server or via browser?

    Thanks,

    Alex

  • David Hutson 48 posts 379 karma points
    May 05, 2017 @ 11:05
    David Hutson
    0

    I recommend you user a modern browser like Chrome to debug the issue. In Chrome use inspector (F12) to look at the console tab and see which status codes are being returned for the missing items.

    Depending on the HTTP status code you will need to make changes to different areas of IIS. Once you know the code you can use Google to narrow done which configuration issue needs fixing. I think since IIS 7 you can control the configuration of IIS in the web.config so this is where to start looking.

    HTTP status code is your quickest path to fixing it

    Status codes:

    • 401 would suggest that you have an authentication issue
    • 403 Forbiden
    • 404 page is missing
    • 500 server error, something wrong with the code

    If you can't get enough information from Chrome then install Fiddler it's a web debugging proxy and sits between your broswer and the server to capture all the traffic. This can really pin down tricky issues. It's especially helpful with Ajax requests or replaying a request.

    Best of luck.

Please Sign in or register to post replies

Write your reply to:

Draft