[pmwiki-users] Re: Re: Re: Question about HTML output for link targets

chr at home.se chr at home.se
Fri Feb 4 04:09:40 CST 2005


On Thu, 3 Feb 2005, Patrick R. Michaud wrote:

> > Is something like '/wiki/pmwiki.php' really a URI? Maybe the variable
> > actually should have been $ScriptPath?  
> 
> A URI without a (server) location and access scheme is called a 
> "relative URI"  and is defined in section 5 of RFC 2396.  So yes,
> it's still a URI.  :-)

Good, now I don't have to worry about terminology anymore :-)

> URIs that are independent of the context in which the identifier is
> used are called "absolute URIs".
> 
> > As for $ScriptHostUrl, do you mean
> > that: $ScriptUrl could either be e.g. 'http://pmwiki.org/wiki/pmwiki.php',
> > or simply 'wiki/pmwiki.php', whereas $ScriptHostUrl always starts with 
> > 'http://...'?
> 
> It'd have to be '/wiki/pmwiki.php' to be relative, but yes, the idea
> was that $ScriptHostUrl would always be absolute while $ScriptUrl could
> be set either absolute or relative depending on the needs of the 
> administrator.
> 
> PmWiki would likely default to a relative setting for $ScriptUrl, and
> use $ScriptHostUrl in those places where it's known that relative uris
> have caused trouble in the past (i.e., search forms, mailpost scripts,
> etc.).

Why not use $ScriptRelativeUrl for the URL that's supposed to be relative,
and $ScriptAbsoluteUrl for a URL that's always absolute? It's verbose 
anyway... I think there should be a "completing" variable though, i.e. 
so that
	$ScriptAbsUrl = $ScriptHostUrl.$ScriptRelUrl
is always satisfied. 

Oh, is it always clear what the relative URL will be relative with respect 
to? 

Btw, it seems there's an analogy here with the page name discussion? From
that point of view, should we have something like:
* $ScriptHostUrl - 'http://pmwiki.org'
* $ScriptPathUrl - '/wiki/pmwiki.php'
* $ScriptFullUrl - "$ScriptHostUrl$ScriptPathUrl"

/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr





More information about the pmwiki-users mailing list