jezzipin
jezzipin

Reputation: 4254

Treat application as root context IIS

I have just moved my Umbraco site from my development environment to an cloud hosted IIS solution that we have full control over. This solution hosts multiple sites and I have merely added my Umbraco folder and code into the wwwroot folder and created this as a new application. The problem I have is most of the Umbraco code seems to be pointing to the root directory of the IIS server so how do I make it so that for this application only it sees it's containing folder as the root?

For instance, in my code Umbraco renders some of the file paths as:

/media/1028/myimage.png

This means that it points to:

www.myiisserver.com/media/1028/myimage.png

Whereas it should be looking at:

 www.myiisserver.com/mynewumbracosite/media/1028/myimage.png

I'm new to IIS as I typically work with Apache servers but there must be some way of setting the root directory for an application so that it always include the application directory in any urls.

Any help would be greatly appreciated.

Upvotes: 0

Views: 575

Answers (1)

Tim
Tim

Reputation: 4257

One thing to check first. Was the media uploaded to the Umbraco site when you were developing locally (presumably not in a virtual directory)? If so, the media has been saved with that path, rather than the virtual directory one. To test this, add a new media item to the media section and see if the path has the virtual folder in it. If it does, you can fix the paths on the older media items with this handy script: http://shazwazza.com/post/sql-script-for-changing-media-paths-or-virtual-directories-in-umbraco/

If it's not that, check that the site is configured correctly, in IIS, the folder the site is in should be configured as a virtual directory. Next, in the umbracoSettings.config file, ensure that ResolveUrlsFromTextString is set to true, as detailed here: https://our.umbraco.org/documentation/using-umbraco/config-files/umbracoSettings/

Upvotes: 1

Related Questions