Confluence 4.1.6 does not recognize this as a link
Asked by Devu Heda:

Hi,

I have the following link when i add this to the page in Confluence 4.1.6 it treats it as a simple text any idea what te issue is?

```
http://qa.test.com/php/tsi_tests_set.php?product=test_cloud&amp;version=Version^1.0.0^build^V001^GA-1&amp;area=&amp;category=runtime&amp;report_type=byPlatform&amp;oracle_sid=test&amp;username
```

I see this in the source editor

```
&lt;a&gt;http://qa.test.com/php/tsi_tests_set.php?product=test_cloud&amp;amp;version=Version^1.0.0^build^V001^GA-1&amp;amp;area=&amp;amp;category=runtime&amp;amp;report_type=byPlatform&amp;amp;oracle_sid=test&amp;amp;username&lt;/a&gt;
```

thanks


Answers:
author: Andrew Frayling
body: Hi Dave,

It's the Caret ("\^") characters that are causing the problem. Try encoding them using %5E, e.g.:

```
http://qa.test.com/php/tsi_tests_set.php?product=test_cloud&amp;version=Version%5E1.0.0%5Ebuild%5EV001%5EGA-1&amp;area=&amp;category=runtime&amp;report_type=byPlatform&amp;oracle_sid=test&amp;username
```

Hope that helps?

Andrew.

comments: author: Devu Heda
body: Thanks Andrew this is a good workaround but i have 1000s of links that are broken and i am not sure how i can go and fix all those ....

I will wait to see if someone can provide me with an option to replace all my broken links in an automated way

thanks


author: Andrew Frayling
body: Hi Dave,

A couple of questions:

1. What database platform are you using?  
2. How many unique URLs need to be changed? Is it 1000's of unqiue URLs or a handful of unique URLs repeated 1000's of times at different locations/versions of pages?

Depending on database platform and if it's a handful of repeated URLs you could change them directly in the database with SQL simialr to the following:

```
UPDATE BODYCONTENTSET BODY = REPLACE(BODY,'&lt;a&gt;http://qa.test.com/php/tsi_tests_set.php?product=test_cloud&amp;amp;version=Version^1.0.0^build^V001^GA-1&amp;amp;area=&amp;amp;category=runtime&amp;amp;report_type=byPlatform&amp;amp;oracle_sid=test&amp;amp;username&lt;/a&gt;','&lt;a href="http://qa.test.com/php/tsi_tests_set.php?product=test_cloud&amp;amp;version=Version%5E1.0.0%5Ebuild%5EV001%5EGA-1&amp;amp;area=&amp;amp;category=runtime&amp;amp;report_type=byPlatform&amp;amp;oracle_sid=test&amp;amp;username"&gt;http://qa.test.com/php/tsi_tests_set.php?product=test_cloud&amp;amp;version=Version%5E1.0.0%5Ebuild%5EV001%5EGA-1&amp;amp;area=&amp;amp;category=runtime&amp;amp;report_type=byPlatform&amp;amp;oracle_sid=test&amp;amp;username&lt;/a&gt;');COMMIT;
```

i.e

```
UPDATE BODYCONTENTSET BODY = REPLACE(BODY,'string to find','replacement string');COMMIT;
```

After updating the database you then need to flush the caches via Browse -\> Confluence Admin -\> Cache Statistics -\> Flush All

The above SQL works on Confluence 4.x and MySQL

NB: in the replacement you have to insert the full link, e.g. \<a href=...\>link text\</a\> as just updating "\^" to "%5E" will not fix the broken link.

Hope that helps,

Andrew.


author: Devu Heda
body: Andrew, thanks for the detail response ...I am using Oracle and have 100s of unique URLs, will give it a try....


author: Andrew Frayling
body: Glad I could help, the same syntax should work for Oracle.

Usual warnings apply of making sure you have a backup, test with a small number of URLs first, try in a test environment, etc. :-)


Tags: link