On 12/20/07, Andre-John Mas <ajmas(a)sympatico.ca> wrote:
I have recently installed Mediawiki as part of my
website. Because I am
integrating it into an existing site I need to be able to link to stuff
already there. The issue I am currently having is that the site is accessed
via two URLs (internal and external). For this reason I need links refering
to the existing site to be relative.
If understand correctly, you're saying the second half of such a link
(to non-mediawiki parts of your site) remains the same, but the first
half varies depending on how the site is being accessed.
If this is the case, and if the "internal" URL is only used by the
webmaster (you), you could probably "internalize" all of the links
(for you only) using a personal javascript at
"User:Your_account_on_the_wiki/monobook.js" by doing a search and
replace on all urls matching the "external" format.
Something like:
addOnloadHook(function(){
a = document.getElementsByTagName("a");
for(x = 0; x < a.length; x++)
a[x].href =
a[x].href.replace(/yoursite\.com/i,
"back.door.of.yoursite.com");
});
Of course this would be bad if the other domain name is supposed to be secret.
If there are multiple users of the "internal" urls, you could copy
this to the common.js and have it decide, based on the wgServer
variable, whether or not to change the links.
Wiki source? Also, is this limitation by philosphy or
by coding
practicality?
Probably not something anybody thought of.
—C.W.