Skip to main content
March 29, 2010
Answered

Relative paths to external links?

  • March 29, 2010
  • 1 reply
  • 1027 views

Hello

I'm using RH 7 HTML. The server hosting my webhelp was just changed and I need to edit all external links; they all currently lead to dead-ends. A developer suggested using relative paths to ensure I wouldn't have to modify every url should the hosting server change again. Although it is a good idea, I'm not sure it is possible, since the links lead to a different project. Is this a realistic solution?

Thanks for your help

This topic has been closed for replies.
Correct answer MergeThis

All you have to do is work out (actually up and down) from the file you're in, not the full path..

For example, linking from helpproject/html/howto/en/10000.htm to helpproject/html/hlp/en/1000.htm means you only have to work within the folder structure I marked in bold.

  1. Go up one folder to "hlp/" and up another folder to "html/" (up two folders)
  2. Once you have arrived to "html/ you go down to hlp/en/1000.htm

Therefore, your relative link is: <a href="../../hlp/en/1000.htm">MyLink</a>

Good luck,

Leon

1 reply

RoboColum_n_
Legend
March 30, 2010

Where are these external project links located on the same server? If so, you could use a relative link. Provided neither of the project's output moves from that server the links would work.


  • Read the RoboColum(n) for a tips, tricks and musings on the Technical Communication Suite products.
  • Follow the RoboColum(n) on Twitter
March 30, 2010

I tried inserting relative links but it is not working; I'm guessing I'm doing it wrong.

My absolute link is similar to www.help.ca/helpproject/html/howto/en/10000.htm; I want to link to www.help.ca/helpproject/html/hlp/en/1000.htm. I'm guessing (I am still new at this) that my root directory is helpproject since it is the first level after the server name. I changed the target link to ../../../../1000.htm. When I try to view the result, I get an error message saying the browser cannot access file:///C:/1000.htm. Then RH displays the Server Busy popup window and I get stuck in a loop clicking either Switch To or Retry, even though the Internet Explorer browser is open.

Back in RH, in the HTML tab, the link still is  ../../../../1000.htm. I even tried pasting a \ instead of a / (as it appears so for image links in RH7) but still no success.

Any ideas? Thanks for your help

MergeThis
MergeThisCorrect answer
Inspiring
March 31, 2010

All you have to do is work out (actually up and down) from the file you're in, not the full path..

For example, linking from helpproject/html/howto/en/10000.htm to helpproject/html/hlp/en/1000.htm means you only have to work within the folder structure I marked in bold.

  1. Go up one folder to "hlp/" and up another folder to "html/" (up two folders)
  2. Once you have arrived to "html/ you go down to hlp/en/1000.htm

Therefore, your relative link is: <a href="../../hlp/en/1000.htm">MyLink</a>

Good luck,

Leon