1<?xml version="1.0" encoding="UTF-8"?> 2 3<!--*********************************************************** 4 * 5 * Licensed to the Apache Software Foundation (ASF) under one 6 * or more contributor license agreements. See the NOTICE file 7 * distributed with this work for additional information 8 * regarding copyright ownership. The ASF licenses this file 9 * to you under the Apache License, Version 2.0 (the 10 * "License"); you may not use this file except in compliance 11 * with the License. You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, 16 * software distributed under the License is distributed on an 17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 * KIND, either express or implied. See the License for the 19 * specific language governing permissions and limitations 20 * under the License. 21 * 22 ***********************************************************--> 23 24<helpdocument version="1.0"> 25<meta> 26<topic id="textsharedguidehyperlink_rel_absxml" indexer="include" status="PUBLISH"> 27<title id="tit" xml-lang="en-US">Relative and Absolute Links</title> 28<filename>/text/shared/guide/hyperlink_rel_abs.xhp</filename> 29</topic> 30</meta> 31<body> 32<bookmark xml-lang="en-US" branch="index" id="bm_id3147399"> 33<bookmark_value>absolute hyperlinks</bookmark_value> 34<bookmark_value>relative hyperlinks</bookmark_value> 35<bookmark_value>hyperlinks; relative and absolute</bookmark_value> 36<bookmark_value>hyperlinks, see also links</bookmark_value> 37</bookmark> 38<paragraph role="heading" id="hd_id3147399" xml-lang="en-US" level="1" l10n="U" oldref="45"><variable id="hyperlink_rel_abs"><link href="text/shared/guide/hyperlink_rel_abs.xhp" name="Relative and Absolute Links">Relative and Absolute Links</link> 39</variable></paragraph> 40<paragraph role="paragraph" id="par_id3153345" xml-lang="en-US" l10n="U" oldref="46">When you include hyperlinks, two factors must be taken into account: whether they are set as relative or absolute on saving, and whether or not the file is present.</paragraph> 41<list type="unordered"> 42<listitem> 43<paragraph role="listitem" id="par_id3147008" xml-lang="en-US" l10n="U" oldref="47">Choose <switchinline select="sys"><caseinline select="MAC">%PRODUCTNAME - Preferences</caseinline><defaultinline>Tools - Options</defaultinline></switchinline> - <link href="text/shared/optionen/01010200.xhp" name="Load/Save - General"><emph>Load/Save - General</emph></link> and specify in the <emph>Save URLs relative to</emph> field if $[officename] creates <link href="text/shared/00/00000005.xhp#speichern" name="relative or absolute hyperlinks">relative or absolute hyperlinks</link>. Relative linking is only possible when the document you are working on and the link destination are on the same drive.</paragraph> 44</listitem> 45<listitem> 46<paragraph role="listitem" id="par_id3145382" xml-lang="en-US" l10n="U" oldref="48">You should create the same directory structure on your hard disk as that which exists in the web space hosted by your Internet provider. Call the root directory for the homepage on your hard disk "homepage", for example. The start file is then "index.html", the full path being "C:\homepage\index.html" (assuming Windows operating system). The URL on your Internet provider's server might then be as follows: "http://www.myprovider.com/mypage/index.html". With relative addressing, you indicate the link relative to the location of the output document. For example, if you placed all the graphics for your homepage in a subfolder called "C:\homepage\images", you would need to give the following path to access the graphic "picture.gif": "images\picture.gif". This is the relative path, starting from the location of the file "index.html". On the provider's server, you would place the picture in the folder "mypage/images". When you transfer the document "index.html" to the provider's server through the <emph>File - Save As</emph> dialog, and if you have marked the option <emph>Copy local graphics to Internet</emph> under <emph><switchinline select="sys"><caseinline select="MAC">%PRODUCTNAME - Preferences</caseinline><defaultinline>Tools - Options</defaultinline></switchinline> - Load/Save - HTML Compatibility</emph>, $[officename] will automatically copy the graphic to the correct directory on the server.</paragraph> 47</listitem> 48<listitem> 49<paragraph role="listitem" id="par_id3159158" xml-lang="en-US" l10n="U" oldref="49">An absolute path such as "C:\homepage\graphics\picture.gif" would no longer function on the provider server. Neither a server nor the computer of a reader needs to have a C hard drive: operating systems such as Unix or MacOS do not recognize drive letters, and even if the folder homepage\graphics existed, your picture would not be available. It is better to use relative addressing for file links.</paragraph> 50</listitem> 51<listitem> 52<paragraph role="listitem" id="par_id3154046" xml-lang="en-US" l10n="U" oldref="50">A link to a web page, for example, "www.example.com" or "www.myprovider.com/mypage/index.html" is an absolute link.</paragraph> 53</listitem> 54<listitem> 55<paragraph role="listitem" id="par_id3155450" xml-lang="en-US" l10n="U" oldref="51">$[officename] also reacts differently, depending on whether the file referred to in the link exists, and where it is located. $[officename] checks every new link and sets a target and protocol automatically. The result can be seen in the generated HTML code after saving the source document.</paragraph> 56</listitem> 57<listitem> 58<paragraph role="listitem" id="par_id3145317" xml-lang="en-US" l10n="U" oldref="52">The following rules apply: A relative reference ("graphic/picture.gif") is only possible when both files exist on the same drive. If the files are on different drives in your local file system, the absolute reference follows the "file:" protocol ("file:///data1/xyz/picture.gif"). If the files are on different servers or if the target of the link is not available, the absolute reference uses the "http:" protocol ("http://data2/abc/picture.gif").</paragraph> 59</listitem> 60<listitem> 61<paragraph role="listitem" id="par_id3153541" xml-lang="en-US" l10n="U" oldref="53">Be sure to organize all files for your homepage on the same drive as the start file of the homepage. In this way, $[officename] can set the protocol and target so that the reference on the server is always correct.</paragraph> 62</listitem> 63</list> 64<paragraph role="warning" id="par_id3153897" xml-lang="en-US" l10n="U" oldref="54">When you rest your mouse on a hyperlink, a help tip displays the absolute reference, since $[officename] uses absolute path names internally. The complete path and address can only be seen when you view the result of the HTML export, by loading the HTML file as "Text" or opening it with a text editor.</paragraph> 65<embed href="text/shared/00/00000004.xhp#related"/> 66<embed href="text/shared/guide/hyperlink_edit.xhp#hyperlink_edit"/> 67</body> 68</helpdocument> 69