sidebar links are not relative to wgServer - mediawiki

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 http://192.158.17.118/mediawiki-1.35/index.php/Main_Page
The home wiki is at http://192.167.12.128/mediawiki-1.35/index.php/Main_Page
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 = "http://192.158.17.118";
$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):
http://192.158.17.118/mediawiki-1.35/index.php/Kids
How can I change the http://192.158.17.118 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.

Simply write
* Kids|Children
or
* Kids|Kids
The same applies to wiki pages: links to other pages in the same wiki should be [[Kids|children]] or [[Kids]], and not [http://192.158.17.118/mediawiki-1.35/index.php/Kids Kids].

Related

PhpStorm mutualized deployment conflicting server root URL

How to set an absolute project URL, different from the root server URL ?
I look for solutions other than:
Settings: seems out of date (I run PS-181)
leaving server root url empty, tip from Jason Lotito.
The second works for me but the GUI keeps yelling that the server root URL is not specified.
But no longer works if the
Did anyone came with a proper, better solution?
EDIT: How to set the project URL
File
Settings
Build, Execution, Deployment
Deployment
tab Connection: set "web server root URL"
tab Mappings: set "web path on server"
EDIT 2:
So you are sharing the same deployment entry between multiple projects... Why not just make it visible to current project only ... so it become project specific and you enter any data you want without any hacks (as it will have no influence on another project). P.S. The ticket you have mentioned was created long time ago when there were shared entries only. project-specific entries are available for quite few years now... –
I precisely use the same deployment between multiple projects: I have multiple mutualized servers. The only difference between projects of the same server belongs to the "mappings" tab.
Moreover, if I set the Web server root URL to my project domain, I have to hack again the Web path on server ... but putting something (like a /), which is a crappy solution.
Clicking Visible only for this project means that I have to create new deployment for each project (which becomes tedious after 30 copy/paste).
As said in the old ticket, if the Project URL of the mappings tab were an editable text field, all would be much simpler.

I want to create website using tomcat (only html file)so that i can use it with in network by entering ip address ,how can i do?

actually I want to start a small server in my laptop using only html and css without java class files, no servltes, no jsps, or others. When any other in the same network enters the ip address it should open index file (consisting of links to video files so that they can played by other machine) which is written by me. I heard that placing the html files and related files in root folder will help to achieve this thing. If not how can I achieve it using tomcat? is it possible with tomcat?

how to load HTML pages, from a location different from root, on the same server?

I am making my first web site with OSX; this is an internal website for my company.
When the server start, I load pages from a different location, from the one that OSX server used to create my template site (because I do redirects that go on the same IP address, so the pages of the redirect obscure the ones from OSX server). These pages are served by a product called Buildbot (a CI server).
Now, I load the main page from the python directory on my computer, and I would like to avoid to get all the pages for the server there, to not mix them up with the buildbot pages; so I am trying to use the directory that OSX server created for me.
The issue thou, is that I do not know how to link pages...HTML is something that I forgot with time; but I remember that each site starts from a root directory, so the computer is protected by outsiders that may try to force it.
Now, I assume that my root is where the start page is loaded from (in my case is /Library/Python/2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/status/web/templates/), so if I use an href to link to another page, I can just access to this tree.
Which means that my website should be in a folder in this path? I can't seem to access the site where OSX server created the website resource (which in my case is Library/Server/Web/Data/Sites/mySite/).
Has been so long since when I used HTML, so I am quite rusty on the topic, and would appreciate a lot any kind of hint. The site will not be available outside our internal network, so I simply need to link pages and resources scattered on my server HD, and put them on web pages.
Here's how I understand:
Let's say your web root is /root, but you want to have a href to an html file in /dog, for example. Is this correct?
Assuming so, you cannot link an HTML file that is not in the web root, as the browser needs to be able to access it. If you were using a server-side programming language you could do this, but not with HTML.

How to set completely relative URLs

I'm having problems setting URLs in a particular situation. I have a Dreamweaver template, that uses the usual relative to domain URLs (e.g. "/images/foo.png"). This works fine on the server, but in the local environment, it has issues, as it thinks the name of the network drive it is on is the domain, rather than the folder it is in on the drive.
So where as it should be "file://networkdrive/localsite/images/foo.png" it's "file://networkdrive/images/foo.png", this is obviously causing broken links, and if I use other relative URLs, such as "../images/foo.png" then I will have to amend the links every time I make a page that drills further down in the site structure.
I did have one solution, creating a mapped drive pointing at that folder, then "Z:/" was the first layer, and it all worked. That was until our communications team needed to see it on their Macs, Macs can't do drive letters as I've found from Googling, so I'm back to the same problem as before.
Any ideas on how I could force the URL to be correct when using "/images/foo.png"? This will save me a lot of headaches when creating pages if it could be done.
Run a local web server, like Nginx, lighttpd, Apache, or Python’s out of your project directory:
python -m http.server # Python 3
python -m SimpleHTTPServer # Python 2
This comes closest to a real environment for development, and it’ll allow you to test things like server-side code and Ajax.
Alternatively, you can use relative URLs everywhere, and one <base> tag per page.
<base href="../">
Don’t.

Simple HTML directory/index.html issue

I feel like a baby for having to do this but bear with me. I'm trying to set up webpage structures on my desktop in a folder. It's got an index.html and a couple folders of its own. One folder, "research", has its own index.html. I'm trying to link to this page from the higher index.html with but instead of taking me to research/index.html it takes me to a 'file-directory view' (for lack of knowing what to call it) of the directory research/
Clearly I could fix this by doing but that's annoying. Thoughts?
if you want to browse locally, you will have to include the file name. in other words:
<a href='research/index.html'>research</a>
The reason it works on remote servers is because replacement is done by the web server so if you want research/ to work then you will need a local web server such as wamp on windows or mamp on mac.