Windows LibreOffice Write - how to create a relative file hyperlink?

I have several .rtf files with links between them. LibreOffice Write has created absolute file links, but I need these links to work when the files are moved to different directories (on other computers). The directory structures will be the same so relative links will work. How do I create them?

I don’t know if it matters, but the files will be read by Ms Word rather than LibreOffice on the target computers.

Your request is desperate.Writer has its own save format .odt where every feature can be encoded and retrieved unaltered. RTF is a foreign (and obsolete) format which is not totally public. Therefore, it needs translation on open to get a manageable representation and another translation from internal format on save. These translations are not perfect. The approximations hace a cumulative effect which progressively damages your document.

Use M$ Word for your task to get a reliable and predictable result.

rtf being encoded in text, you can post-edit thru basic scripting like perl …
e.g. perl how to change url in text file - Stack Overflow

I’m on Windows - I can just use Notepad to edit the file if need be. I can also save as something other than .rtf. I’m not sure how well Word handles .odt files, but I could use .doc or .docx which LibreOffice handle with no problem (as far as I know).

The real question is whether LibreOffice Write can produce relative, rather than absolute file links.

https://help.libreoffice.org/latest/en-US/text/shared/guide/hyperlink_rel_abs.html

Thank you for pointing to the help doc. As near as I can tell, changing the “Save URLs relative to …” option did nothing. The links were still absolute. When saving the file in another directory (that has a copy of the target file) the link still uses the path to the the original directory.

I tried this with both ,rtf and .docx files. I have not tried .odt files.

The doc refers to .html files multiple times and refers to URLs rather than file URIs. Could relative links be supported only in .html files? (I doubt it, but I thought I’d ask.)

If I save as .docx, .doc, or .odt the hyperlink is relative. If I save as .rtf then it is absolute.

If you want rtf with relative links then use Word, in my experiments the rtf from LibreOffice was 4kb while the one saved from Word, which did have relative hyperlinks, was 36 kb, larger than any other file format.

Odd. I don’t know what I did wrong. I’ll try it again with .docx.

I tried again and it did work correctly in .docx. I don’t know what I did wrong earlier.

Thank you for your help.