I'm using v1.8.2 on Red Hat Linux 8.0 (Tomcat connected to Apache with a JK2 connector)

Is there any way I can create HTTP links that resolve to the same server without hard-coding the servers IP address or fully qualified name?

If my server is named "bogus.cmu.edu" and (via JK2) "http://bogus.cmu.edu/jspwiki" is my JSP wiki site. Now this server is also running Bugzilla at "http://bogus.cmu.edu/bugs/" and Mailman at "http://bogus.cmu.edu/mailman/". So I want to create links from the JSP wiki site to these I use:

Go to [Bugzilla|http://bogus.cmu.edu/bugs/] \\
Go to [Mailman|http://bogus.cmu.edu/mailman/]

The problem (as I see it) is that the server name is hard coded and won't float with the Wiki installation. I'd really like to use relative links or a variable that includes the server name. Thoughts/ideas? Have I missed a rather obvious way to do this? Tim Halloran

Hmmm, After a bit more investigation there are actually two legal relative references:

<a href="/myfile.html">The type I talked about above</a>
<a href="//myserver.com/index.html">protocol relative</a>

The first is what I'm after, the second allows a link to "carry" the type of connection (secure or unsecure) through the link. Tim Halloran

You can use InterWiki links to do that. If you include in your jspwiki.properties
Writing [Bugzilla|bugzilla:test.html] creates <a href="/bugs/test.html">...,
using [Bugzilla|bugzilla2:test.html] will create the link <a href="http://bogus.cmu.edu/bugs/test.html">....

See also InterWikiLinkTips.

-- Torsten

I had a similar problem, I want to put images that are on the site into the pages without using the full URL. I also had the added problem of wanting to be able to do parameters for the image. My solution was to build a Wiki Plugin (IMG) to support the image. A plugin is easy to write, it may be a way to solve your problem.

Good luck,


Try this: http:/pagename.html Note there is only one slash. I'm pretty sure you could refer to a relative page with no slash, but that's not normally useful in a Wiki.

Steve Smith

Category Tips, Category Documentation

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-11) was last changed on 04-Nov-2006 20:17 by