foo.com/path/to/index.html?orig foo.com/path/to/ foo.com/path/to/bar foo.com/path/to/bar#baz foo.com/path/to/bar?baz foo.com/path/to/bar?baz#baz2 foo.com/path/to/index.html?orig#baz foo.com/path/to/index.html?baz foo.com/path/to/index.html?baz#baz2 foo.com/path/up.a.notch.html#wow foo.com/path/up.a.notch.html?wow foo.com/path/up.a.notch.html?wow#wow2 foo.com/root.cgi#OK foo.com/root.cgi?OK foo.com/root.cgi?OK#OK2 elsewhere.com/#deep elsewhere.com/?deep elsewhere.com/?deep#deep2