Confluence Support Non-http/ftp Hyperlinks?
Asked by Phillip Ponzer [Cprime]:

Does Confluence support hyperlinks to pages that don't have a "http" or "ftp" in front of it?

For instance, svn or starteam links?


Answers:
author: Phillip Ponzer [Cprime]
body: Alright, after a good day of work I've managed to come up with a three-part solution:

Since this is as a result of the UWC working its conversion magic (thank goodness we have UWC!), "illegal" characters were getting removed. The problem with this is that colons, semi-colons, and forward-slashes are all part of the standard Starteam link. This was overcame by "escaping" those illegal characters. Like so:

```
[settings.illegalcharmap.properties]# : (colon)illegalchar.colon.replacement=\:# ; (semi-colon)illegalchar.semicolon.replacement=\;# / (forward slash)illegalchar.forwardslash.replacement=\/# @ (at)illegalchar.at.replacement=\@
```

Why the ampersand (@)? We'll get to that later...

This got us as far as getting the UWC to convert the Starteam links into something that's copy/pastable into Starteam. Although it did chop off the prefixed "starteam://" from the link itself, it was still somewhat "followable."

Here's the next bit of UWC regular expression magic:

```
[converter.mediawiki.properties]Mediawiki.0411.starteam.java-regex=\[starteam://(\S+)+\s*(.*)\]{replace-with}$2: [$1@starteam]
```

This regular expression will take all bracketed links prefixed with "starteam://" and throw it into a Starteam shortcut link.

A shortcut link, you say? Why yes, a shortcut link!

![](../../upfiles/confluence_shortcut_links.png)

You can get to this as a Confluence Admin by going to Browse-\>Confluence Admin, and click on "Shortcut Links" under "Configuration." In effect, this is why we needed the ampersand to be escaped back in the \[settings.illegalcharmap.properties\] file.

So, what does this do? Well, the help text just above the shortcut link table explains it pretty well. But pretty much what it does is it takes your Starteam link, prefixes it with "starteam://" and wraps the link tag around the text "Starteam Link".

So, typing in \[starteam://my.starteam.link/a:12345;b:67890 Software Plans Summary\] in a WikiMedia page will give you the hyperlinked text "Software Plans Summary".

When shoved through the UWC (with the options from above), you get the following:

```
Software Plans Summary: [my.starteam.link/a:12345;b:67890@starteam]
```

Which simply ends up looking like this on a Confluence page:

```
Software Plans Summary: Starteam Link 
```

comments: author: Phillip Ponzer [Cprime]
body: I've raised a ticket for this issue here:

<https://jira.atlassian.com/browse/CONF-24700>


author: Andrew Frayling
body: Hi Phillip,

It might be worth raising a ticket at [support@atlassian.com](mailto:support@atlassian.com) to ask which links Confluence strips out. I've done a quick test using the $wgUrlProtocols for MediaWiki as documented at <http://www.mediawiki.org/wiki/Manual:$wgUrlProtocols> and Confluence 4.1.2 (the version I tested on) strips out:

* gopher
* telnet
* worldwind
* mms

but did leave svn, ftp, irc, nntp, etc. alone. I also tried a link using starteam:// and this got stripped out as well.

As mentioned above it might be worth contacting [support@atlassian.com](mailto:support@atlassian.com) for a definitive list as I can't find anything in the documentation about which links Confluence strips out and which it leaves alone.

Hope that helps,

Andrew.

comments: author: Phillip Ponzer [Cprime]
body: This is another one of those questions where I probably should have indicated that I'm using the UWC to convert our MediaWiki into Confluence. starteam links have a few of those illegal characters in them and so right now I'm exploring encoding the URL so that no actual damage is done to the link. I'll post back if I figure anything out.


author: Phillip Ponzer [Cprime]
body: FWIW, here's my other very related post on this topic:  
[https://answers.atlassian.com/questions/31786/possible-to-convert-hyperlink-with-illegal-characters](/questions/31786/possible-to-convert-hyperlink-with-illegal-characters)


Tags: ftp

http

link

universal-wiki-converter