Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others


0 votes
in Technique[技术] by (71.8m points)

mediawiki - sidebar links are not relative to wgServer

I have a personal wiki running on Ubuntu at work, and at home. I keep the two in sync via script files that copy files (mediawiki folder and mysql folder) from the work wiki to a Dropbox folder. I then copy the changed files down to the home wiki machine (and vice versa). This has worked really well...until now.

The work wiki is at

The home wiki is at

The different base ip addresses has not been a problem until now because I have the following in my LocalSettings.php to set wgServer dynamically.

## The protocol and server name to use in fully-qualified URLs
#$wgServer = "";
$wgServer = WebRequest::detectServer();

Now, I made a change to my sidebar menu to insert a couple of links to pages down in my wiki. The problem is that these new links are not constructed relative to the dynamic wgServer ip address:

For example, one link has this URL on BOTH the home and work wiki (after I sync):

How can I change the part of the link so it is dynamically recognized regardless of the ip address of the wiki?

p.s. I'm running the wiki's on Ubuntu Mate 20.10 (Groovy Gorilla) on VMware Workstation 16 Pro on Win 10 Pro machines. VMware Workstation hands out ip addresses to the virtual clients and it looks pretty well awful to try and set a static for a client. I'd much rather find a nice wiki solution.

Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share