[pmwiki-users] Absolute URLs, why does it generate them?
Patrick R. Michaud
pmichaud at pobox.com
Sun Mar 25 23:15:29 CDT 2007
On Sun, Mar 25, 2007 at 10:01:19PM -0400, Sandy wrote:
> In the default install, pmwiki puts absolute urls in the HTML file, even
> for pages within the same wiki?
> Is there a reason for this?
PmWiki currently does all of its internal urls using $ScriptUrl, which
it expects to be a complete url. For links we could potentially use
relative references, but PmWiki still needs a complete url in some
cases in order to produce valid RSS feeds and for certain form
In the past we've contemplated having separate variables for
complete urls and relative references, but doing this adds a lot
of configuration complexity (especially for new administrators).
> Can it be changed with a flag?
However, now that I read this it occurs to me that we could introduce
a $EnableRelativeUrls configuration option, and then those parts of
PmWiki that can safely use relative references could strip the
scheme and server portion of the urls from the output. This would
include internal page links.
That could be a very useful compromise.
However, at present there's not a flag or totally reliable mechanism
to get PmWiki to generate relative references.
> Is this the reason httrack and other site-copying programs don't work?
It could be. I've typically used the -k option to wget(1) in order
to download copies of pages; the -k option tells wget to automatically
adjust links after it downloads everything. That's always worked for
me. (See http://www.pmwiki.org/wiki/Cookbook/ExportHTML .)
So, you might see if HTTrack has a similar option. However, while
I'm on the topic, I'll note that I've completely banned HTTrack
(at the webserver level) on my sites, because I've found it to
be incredibly server unfriendly, as it tends to flood servers
with a large number of simultaneous requests. Also, by default
it doesn't recognize rel='nofollow' in links, so it tends to
issue requests for a lot of useless pages such as edits, page history,
uploads, etc. (Perhaps this has changed in later versions of HTTrack,
it's never been worth my while to check. :-)
Hope this helps,
More information about the pmwiki-users