Links to source files (CSS, JS, images) now behave like static sites

In the past, it was important that all file paths in Webvanta sites begin with a slash, making them relative to the root of the site explicitly. This worked fine, except that many site templates, and the default code generated by HTML and CSS editors, often did not do this. Instead, they would use references like:

    <link href="stylesheets/styles.css" rel="stylesheet" type="text/css">

and for this to work reliably with Webvanta, even if the referencing document was itself at the root, you had to edit it to use:

    href="/stylesheets/styles.css"

Another common coding practice is to use references like:

   href="../stylesheets/styles.css"

to refer to a document that is relative to the current document, which also caused problems with Webvanta.

Similar problems existed when referencing JavaScript files, images, and other assets.

We've now changed the way we locate files so most code from existing sites and templates should work unmodified, and you no longer need to be sure to start each path with a slash (unless you need to be explicit about the path for other reasons). We more closely follow the same rules that you would encounter with a static site.

One side effect: with the old system, there was some magic going on that would often find files even if you didn't specify the full path. That will no longer work; just like on a static site, you need to have the exact path. (Note that pages are a different matter, and Webvanta continues to find pages even if the URL is not complete; for example, you can use http://mysite.com/pagename to access http:/mysite.com/section/pagename, and it will still work as long as pagename is unique across all parts of the site.)

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk