# Examples of Resolving Relative URLs, Part 2

This document has an embedded base URL of

       Content-Base: http://a/b/c/d;p?q=1/2

the relative URLs should be resolved as shown below. In this test page, I am particularly interested in testing whether "/" in query information is or is not treated as part of the path hierarchy.

I will need your help testing the examples on multiple browsers. What you need to do is point to the example anchor and compare it to the resolved URL in your browser (most browsers have a feature by which you can see the resolved URL at the bottom of the window/screen when the anchor is active).

## Tested Clients and Client Libraries

[R]
  RFC 2396 (the right way to parse)
[X]
  RFC 1808
[1]
  Mozilla/4.03 [en] (X11; U; SunOS 5.5 sun4u; Nav)
[2]
  Lynx/2.7.1 libwww-FM/2.14
[3]
  MSIE 3.01; Windows 95
[4]
  NCSA_Mosaic/2.6 (X11;SunOS 4.1.2 sun4m) libwww/2.12

### Synopsis

RFC 1808 specified that the "/" character within query information does not affect the hierarchy within URL parsing. It would appear that it does in current practice, but only within the relative path after it is attached to the base path. In other words, the base URL's query information is being stripped off before any relative resolution, but some parsers fail to separate the query information from the relative path.

We have decided that this behavior is due to an oversight in the original libwww implementation, and it is better to correct the oversight in future parsers than it is to make a nonsensical standard. A note has been added to the URI draft to account for the differences in implementations. This should have no impact on current practice since unescaped "/" is rarely (if ever) used within the query part of a URL, and query parts themselves are rarely used with relative URLs.

## Examples

                  RESULTS                     from

    g          =  http://a/b/c/g              [R,X,1,2,3,4]

    ./g        =  http://a/b/c/g              [R,X,1,2,3,4]

    g/         =  http://a/b/c/g/             [R,X,1,2,3,4]

    /g         =  http://a/g                  [R,X,1,2,3,4]

    //g        =  http://g                    [R,X,1,2,3,4]

    g?y        =  http://a/b/c/g?y            [R,X,1,2,3,4]

    g?y/./x    =  http://a/b/c/g?y/./x        [R,X]
                  http://a/b/c/g?y/x          [1,2,3,4]

    g?y/../x   =  http://a/b/c/g?y/../x       [R,X]
                  http://a/b/c/x              [1,2,3,4]

    g#s        =  http://a/b/c/g#s            [R,X,1,2,3,4]

    g#s/./x    =  http://a/b/c/g#s/./x        [R,X,2,3,4]
                  http://a/b/c/g#s/x          [1]

    g#s/../x   =  http://a/b/c/g#s/../x       [R,X,2,3,4]
                  http://a/b/c/x              [1]

    ./         =  http://a/b/c/               [R,X,1,2,3,4]

    ../        =  http://a/b/                 [R,X,1,2,3,4]

    ../g       =  http://a/b/g                [R,X,1,2,3,4]

    ../../     =  http://a/                   [R,X,1,2,3,4]

    ../../g    =  http://a/g                  [R,X,1,2,3,4]