How are relative URLs in the link/html parameter handled? (url = "/explore...", etc.)

Knowledge Drop

Last tested: Aug 23, 2019
 

To understand how relative URLs in the link/html parameter are handled, it is helpful to understand how relative URLs work in browsers in general. This stackoverflow post has a detailed description of the different types of relative URLs and how they work, but the basic rules are as follows:

  1. If there are two leading slashes, it is scheme relative
  2. If there is one leading slash, it is root relative
  3. If there is no leading slash, but there is a colon, assume it is an absolute URI
  4. If there is no leading slash, and no colon, it is location relative

Examples: Suppose that you are navigating from https://example.looker.com/explore/model1/explore1?qid=[query hash].

  1. Scheme relative: url: "//foo" will navigate to https://foo
  2. Root relative: url: "/foo" will navigate to https://example.looker.com/foo
  3. Absolute URI: url: "fo:o" will navigate to fo:o
  4. Location relative: url: "foo" will navigate to https://example.looker.com/explore/model1/foo

This content is subject to limited support.                

Version history
Last update:
‎07-07-2021 12:49 PM
Updated by: