Resources only load when trailing forward slash is omitted from URL (v 7.0.1)
Hi,
I have a rather bizarre problem involving display rendering. My content will only render properly when there is no forward slash (/) at the end of my URLs. I have determined that I am getting errors when the styles and dependency resources load. For some reason, when the forward slash is appended to the end of the URL, the resources try to load from a different URL than they should. For example, when I try to load http://localhost:18996/getting-started/, the images load from http://localhost:18996/getting-started/images/, which doesn't exist. When I load http://localhost:18996/getting-started, however, the images load from the correct location (/images). I am getting the same problem with styles. For example, when I try to load http://localhost:18996/getting-started/, one of my style sheets tries to load from http://localhost:18996/getting-started/css/style.css when it really should just be loading from /css/style.css. All of the other styles exhibit the same phenomena. Interestingly, the same problem does not occur with javascript files. They all seem to load from /scripts just fine.
I am running:
MVC 4
ASP.NET v4.0.30319
Umbraco 7.0.1
Windows 7 (x64)
Visual Studio 2012 Ultimate
Umbraco was installed on this machine via NuGet Package
I tried renaming the TEMP folder (App_Data\TEMP), but that didn't seem to affect this. Setting to (config\umbracoSettings.config) seems to provide a workaround, but the workaround doesn't prevent users and search engines from finding the broken links. The workaround also doesn't seem to solve problems involving children. For example, http://localhost:18996/go-further/test-me still fails to resolve css and images properly (due to the same bug). All of the images of http://localhost:18996/go-further/test-me return 404 pages.
The last thing that changed is that I installed OAuth through Nuget, but I honestly don't know how long this URL issue has been a problem. It very well may have been an issue before I installed OAuth.
would not render properly if a trailing forward slash (/) was included in the URL. The simple solution was to refer to the application root directory by adding ~/ to all css and js file includes, such as:
Resources only load when trailing forward slash is omitted from URL (v 7.0.1)
Hi,
I have a rather bizarre problem involving display rendering. My content will only render properly when there is no forward slash (/) at the end of my URLs. I have determined that I am getting errors when the styles and dependency resources load. For some reason, when the forward slash is appended to the end of the URL, the resources try to load from a different URL than they should. For example, when I try to load http://localhost:18996/getting-started/, the images load from http://localhost:18996/getting-started/images/, which doesn't exist. When I load http://localhost:18996/getting-started, however, the images load from the correct location (/images). I am getting the same problem with styles. For example, when I try to load http://localhost:18996/getting-started/, one of my style sheets tries to load from http://localhost:18996/getting-started/css/style.css when it really should just be loading from /css/style.css. All of the other styles exhibit the same phenomena. Interestingly, the same problem does not occur with javascript files. They all seem to load from /scripts just fine.
I am running:
I tried renaming the TEMP folder (App_Data\TEMP), but that didn't seem to affect this. Setting to (config\umbracoSettings.config) seems to provide a workaround, but the workaround doesn't prevent users and search engines from finding the broken links. The workaround also doesn't seem to solve problems involving children. For example, http://localhost:18996/go-further/test-me still fails to resolve css and images properly (due to the same bug). All of the images of http://localhost:18996/go-further/test-me return 404 pages.
The last thing that changed is that I installed OAuth through Nuget, but I honestly don't know how long this URL issue has been a problem. It very well may have been an issue before I installed OAuth.
Hi,
I had the exact problem with css and js included files, for example:
would not render properly if a trailing forward slash (/) was included in the URL. The simple solution was to refer to the application root directory by adding ~/ to all css and js file includes, such as:
Problem solved.
is working on a reply...