Some buttons and links in Confluence point to bogus URIs
Asked by Chris Leduc:

Good morning!

We've been using Confluence for a while, but since it's been reinstalled, there is a problem that appears for some but not all of the links and buttons in Confluence.

They point to things such as...

<http://pages/editpage.action?pageId=786435>

<http://admin/console.action>

Essentially in the source, just to take a random example of the file <http://confluence.swiss-va.com/display/R/Home>

```
&lt;li class="normal ajs-menu-item"&gt;        &lt;a id="browse-menu-link" class="browse trigger ajs-menu-title" href="#"&gt;&lt;span&gt;&lt;span&gt;Browse&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;         &lt;div class="assistive ajs-drop-down"&gt;                        &lt;ul  id="browse-menu-link-leading"                 class="section-leading first"&gt;                                        &lt;li&gt;                    &lt;a  id="space-pages-link" href="//pages/listpages.action?key=R"  class=""   title="Browse pages in the Relaunch 2013 space"&gt;                   &lt;span&gt;Pages&lt;/span&gt;&lt;/a&gt;        &lt;/li&gt;                                        &lt;li&gt;                    &lt;a  id="space-blogposts-link" href="//pages/viewrecentblogposts.action?key=R"  class=""   title="Browse blogs in the Relaunch 2013 space"&gt;                   &lt;span&gt;Blog&lt;/span&gt;&lt;/a&gt;        &lt;/li&gt;                                        &lt;li&gt;                    &lt;a  id="space-labels-link" href="//labels/listlabels-heatmap.action?key=R"  class=""   title="Browse labels in the Relaunch 2013 space"&gt;                   &lt;span&gt;Labels&lt;/span&gt;&lt;/a&gt;        &lt;/li&gt;                                        &lt;li&gt;                    &lt;a  id="space-attachments-link" href="//spaces/listattachmentsforspace.action?key=R"  class=""   title="Browse attachments in the Relaunch 2013 space"&gt;                   &lt;span&gt;Attachments&lt;/span&gt;&lt;/a&gt;        &lt;/li&gt;                                        &lt;li&gt;                    &lt;a  id="space-mail-link" href="//mail/archive/viewmailarchive.action?key=R"  class=""   title="Browse mail in the Relaunch 2013 space"&gt;                   &lt;span&gt;Mail&lt;/span&gt;&lt;/a&gt;        &lt;/li&gt;                                        &lt;li&gt;
```

Manually prepending the server name between http:// and the rest obviously works fine, but we'd rather do without.

If you have any ideas about what's causing this, let me know what you need to diagnose. I'll do my best!

Thanks for your help and hints!

Chris


Answers:
author: Andrew Frayling
body: Just found this KB article which may be more relevant than my previous suggestions - <http://confluence.atlassian.com/display/JIRAKB/Some+Links+Lose+the+Base+URL>

It's for JIRA, but it's likely that the same would apply to Confluence. Check your server.xml file where the Context path is set and if it's set to "/" change it to "" if users access Confluence at [http://confluence.swiss-va.com](http://confluence.swiss-va.com/) or "/confluence" if users access Confluence at [http://confluence.swiss-va.com](http://confluence.swiss-va.com/)/confluence

Andrew.

comments: author: Andrew Frayling
body: Hi Chris,

Did any of these suggestions fix the problem?

Andrew.


author: Anil Sreedharan
body: Hello Andrew,I had the same problem. Your final suggestion fixed the issue"Check your server.xml file where the Context path is set and if it's set to "/" change it to "" "


author: Andrew Frayling
body: Hi Chris,

THe thing that immediately springs to mind is the base URL (<http://confluence.atlassian.com/display/DOC/Configuring+the+Server+Base+URL>) not being set in Browse -\> Confluence Admin -\> General Configuration

It's unlikely that the base URL would have been wiped in the config, but that's where I'd start.

Hope that helps?

Andrew.

comments: author: Chris Leduc
body: Hi Andrew

Thanks for your help!

I've checked in the configuration, and the base url is already in. It's as follows:

```
Server Base Url http://confluence.swiss-va.com:8090
```

What is maybe relevant is that the port number is in the base URL. However, we access the server without as Apache is configured to virtually serve confluence on Port 80. The actual used address is <http://confluence.swiss-va.com>.

I've tried changing the value in the general configuration to <http://confluence.swiss-va.com> without success.

Addendum: Visiting [http://confluence.swiss-va.com:8090](http://confluence.swiss-va.com:8090/) sends you back to <http://confluence.swiss-va.com>... Just for info. :-)


author: Andrew Frayling
body: Hmmm, even though removing the port number from the base URL hasn't fixed this issue it needed to be done anyway as the base URL should be set to the URL that users use rather than the backend URL and port of the Confluence server, and at least that's one avenue of investigation closed off :-)

Next places I'd look (in no particular order) would be:

* Anything in the log files related to problems with the base URL?
* Browse -\> Confluence Admin -\> Look and Feel -\> Custom HTML - any custom HTML trying to do any URL rewriting?
* Browse -\> Confluence Admin -\> Look and Feel -\> Layout - any changes to the default layouts?
* Any custom themes?

Is there any pattern to the problem URLs? Does it only happen in a certain Space or Spaces? From the source sample you've provided they're all parameterised URLs, does it happen for just parameterised URLs (<http://pages/editpage.action?pageId=786435>) or does it happen for "normal" URLs as well (<http://display/R/Home/My+Page>)?


Tags: base-url