When I change content of our web site from umbraco and try to preview it is not working. This is because the required umbraco js and css files are not loaded. Our site is hosted in a IIS virtual directory(eg: /localhost/mySite)
The correct path should be for the umbraco files should be,
http://localhost/mySite/umbraco/assets/css/canvasdesigner.css
but the js and css file paths are taken as,
http://localhost/umbraco/assets/css/canvasdesigner.css
Does anyone know how to solve this?
I think this is an issue with relative URL's within Umbraco - you should try setting up your web site as a new web site in IIS with a new record in your hosts file.
You need to make a change to your /config/umbracoSettings.config
Add true under in the umbracoSettings.config file in the config folder.
Related
After publishing a MVC5 web application of mine to my IIS server (Individual User Accounts), it would seem that the URL is accessed incorrectly.
During debug, it would be e.g http://localhost:1234/api/Account/UserInfo?=XXXXX
The debug works just fine. The only issue kicks in after I've published it via my IIS7 server.
After publishing and using Google Chrome's console, it would appear that the page is requesting for a resource at mydomainname.com/api/Account/UserInfo?=XXXX instead of mydomainname.com/WEBAPPLICATIONNAME/api/Account/UserInfo?=XXXX.
My best guess is to modify the URLs in /Scripts/app/app.datamodel.js but it would just cause more parsing problems.
I've searched around and can't seem to find any related problems. I hope someone here will be able to lend a hand.
Look like you are using relative path like "/api/Account/UserInfo". Instead i'll recommend you to use #Url.Content("/api/Account/UserInfo"). This will solve your problem
Explanation
In local system when we run application in WebDev server it never have sub folder (like WEBAPPLICATIONNAME) therefore you relative path work correctly. but when you host your application in IIS under Default website in another new website /Virtual folder (like 'WEBAPPLICATIONNAME') then "/api/Account/UserInfo" fall back to Default Website because for '/' in starting. #Url.Content or #Url.Action make sure to add virtual directory name, hence changing your path to "/WEBAPPLICATIONNAME/api/Account/UserInfo" in IIS.
need your help with this one, i'm running azure deployment on my localhost and get the webpage without css and javascript, when i look in fiddler i see 500 status and the following error: "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS" on each request for javascript or css file, i already enabled static content on windows feature and it didn't help, i'm using iis 7.5 on windows professional 64 bit with azure sdk 1.7, tried anything, and nothing helped, can't change the site to web application cause the website only exist on iis while i'm running debug, any idea what to do?
Could it be that the directory from which you're serving JS/CSS files contains a web.config file? If this is the case this will be causing the problem.
Your web.config contains an element which can only be defined in a real web application (in the root of your application for example- or in the machine.config. To fix this issue you'll need to open the machine.config (C:\Windows\Microsoft.Net\Framework\v4.0.30319\Config\machine.config) and look at each configSection defined here that is also included in your web.config (in the folder containing the JS/CSS files).
If the configSection in the machine.config contains the allowDefinition attribute with MachineToApplication as value this means you cannot use that configSection in a web.config that isn't located in a web application. Meaning in your case you'll need to remove that configSection from the web.config in the folder containing the JS/CSS files.
If you're using ASP.NET MVC this is probably your Content folder.
I'm trying to insert a a javascript file I wrote (just a simple alert box) into the header of my Orchard CMS site. My problem is that I can't get the pathing right to lead to the .js file, I've even tried placing my .js file in the website root folder.
Any ideas how to get the path right?
Ah, you are probably missing a web config in the directory where the script is.
I am having trouble getting my local II7 to load stylesheets when running a default 'File/New' MVC3 website. When I run the site using Visual Studio everything works great. I created an IIS7 website pointed to the root folder of the MVC website. The site comes up, but no stylesheets load. My app pool is set for .NET 4 and Integrated mode.
The same issue was described in this topic, but the fix didn't help me (I already have the 'serve static content' setting checked).
ASP.Net MVC & Local IIS Issue Loading Stylesheets
Any direction is appreciated!
This was solved by enabling Anonymous Authentication in IIS, then right-clicking that node and choosing Edit and choosing Application Pool Identity. Everything loads correctly now. With fiddler I noticed I was getting 401 errors on the stylesheets/js files, so I knew I had a security issue.
In your layout page have the style sheet like:
<link href="#Url.Content("~/folder/style.css")" type="text/css" rel="stylesheet" />
This should help by making it relative to your applications root the #Url(Content("~/ part.
Another thing to check is that Static Content is enabled in Windows Features - this catches me out every time. In Windows 7:
Open Control Panel
Select Programs > Programs and Features > Turn Windows features on or off
Expand Internet Information Services > World Wide Web Services > Common HTTP Features
Check "Static Content"
Click OK and wait before retrying.
As #Mike said, I am almost willing to bet that the problem is that the path to the CSS file is different when you run local than when you run on the server.
Where are your CSS files located at?
For example, if your root IIS folder is c:\inetpub\wwwroot...are your CSS files under
c:\inetpub\wwwroot\somefolder\content\style.css or under
c:\inetpub\wwwroot\content\style.css
?
I had this problem too, and none of the solutions here (or anywhere else that I could find) helped.
The Solution
It turned out that my CSS files were downloaded from an external source in zip format. The files were copied and pasted from the zip file to my IIS directory using Windows Explorer. If you unzip the file first before doing the copy operation, then it won't mess up the permissions and you will be able to view them in IIS.
I have just installed windows 7 and I'm trying to get my MVC application that was working in IIS 7 working in IIS 7.5.
The problem I have is that when it tries to load any static files (css, gif, jpg...) it requires authentication. So if I try to go to:
http://example.com/Content/site.css
It redirects to:
http://example.com/Account/LogIn?ReturnUrl=/Content/site.css
I ended up finding the problem. It seems that i need the IIS_USRS & IUSR accounts to have read access. I'm sure in vista i only had the IIS_USRS account.
For me it ended up being specific static content files that required authentication, while other static content files did not require it. Turns out that those files were green in Windows Explorer. I went to properties, Advanced, on the files and turned off "Encrypt contents to secure data" and my problem was solved.
It looks like you've messed up with something.
If you take the ASP.NET MVC template application (the one created when you start a new MVC Project), it won't require authorization to download static content.
If you provide more information, like your routes, or something else, it will be easier to understand your problem and find a solution for it.