28 Dec 2008
20 Jul 2010
Link to this post
When im developing within sitefinity and editing a site from within the project manager my images which are hardcoded into the html markup do not appear...rightly so, because the url is http://localhost/<project>/default.aspx for example whereas my image relative path is /images/logo.jpg which clearly wont work.
Whats the best practice for working in this way? Obviously when i deploy the public site the url will actually be http://www.website.com so the relative urls will work.
The two approaches I have considered are:
- for development always add the project name to the image url i.e. /<project>/images/logo.jpg and then use the replace tool prior to deployment.
- add a rewrite rule into the web.config that matches .css/.js/jpg etc extensions, and rewrites the url to include /<project>/
Does anyone have any advice?