1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?>
2cdf0e10cSrcweir
3cdf0e10cSrcweir
4cdf0e10cSrcweir
5*226a8927SAndrew Rist<!--***********************************************************
6cdf0e10cSrcweir *
7*226a8927SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
8*226a8927SAndrew Rist * or more contributor license agreements.  See the NOTICE file
9*226a8927SAndrew Rist * distributed with this work for additional information
10*226a8927SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
11*226a8927SAndrew Rist * to you under the Apache License, Version 2.0 (the
12*226a8927SAndrew Rist * "License"); you may not use this file except in compliance
13*226a8927SAndrew Rist * with the License.  You may obtain a copy of the License at
14*226a8927SAndrew Rist *
15*226a8927SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
16*226a8927SAndrew Rist *
17*226a8927SAndrew Rist * Unless required by applicable law or agreed to in writing,
18*226a8927SAndrew Rist * software distributed under the License is distributed on an
19*226a8927SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20*226a8927SAndrew Rist * KIND, either express or implied.  See the License for the
21*226a8927SAndrew Rist * specific language governing permissions and limitations
22*226a8927SAndrew Rist * under the License.
23*226a8927SAndrew Rist *
24*226a8927SAndrew Rist ***********************************************************-->
25*226a8927SAndrew Rist
26*226a8927SAndrew Rist
27cdf0e10cSrcweir
28cdf0e10cSrcweir
29cdf0e10cSrcweir		<helpdocument version="1.0">
30cdf0e10cSrcweir<meta>
31cdf0e10cSrcweir<topic id="textsharedguidehyperlink_rel_absxml" indexer="include" status="PUBLISH">
32cdf0e10cSrcweir<title id="tit" xml-lang="en-US">Relative and Absolute Links</title>
33cdf0e10cSrcweir<filename>/text/shared/guide/hyperlink_rel_abs.xhp</filename>
34cdf0e10cSrcweir</topic>
35cdf0e10cSrcweir</meta>
36cdf0e10cSrcweir<body>
37cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="index" id="bm_id3147399"><bookmark_value>absolute hyperlinks</bookmark_value>
38cdf0e10cSrcweir<bookmark_value>relative hyperlinks</bookmark_value>
39cdf0e10cSrcweir<bookmark_value>hyperlinks; relative and absolute</bookmark_value>
40cdf0e10cSrcweir<bookmark_value>hyperlinks, see also links</bookmark_value>
41cdf0e10cSrcweir</bookmark>
42cdf0e10cSrcweir<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>
43cdf0e10cSrcweir</variable></paragraph>
44cdf0e10cSrcweir<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>
45cdf0e10cSrcweir<list type="unordered">
46cdf0e10cSrcweir<listitem>
47cdf0e10cSrcweir<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>
48cdf0e10cSrcweir</listitem>
49cdf0e10cSrcweir<listitem>
50cdf0e10cSrcweir<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>
51cdf0e10cSrcweir</listitem>
52cdf0e10cSrcweir<listitem>
53cdf0e10cSrcweir<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>
54cdf0e10cSrcweir</listitem>
55cdf0e10cSrcweir<listitem>
56cdf0e10cSrcweir<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>
57cdf0e10cSrcweir</listitem>
58cdf0e10cSrcweir<listitem>
59cdf0e10cSrcweir<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>
60cdf0e10cSrcweir</listitem>
61cdf0e10cSrcweir<listitem>
62cdf0e10cSrcweir<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>
63cdf0e10cSrcweir</listitem>
64cdf0e10cSrcweir<listitem>
65cdf0e10cSrcweir<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>
66cdf0e10cSrcweir</listitem>
67cdf0e10cSrcweir</list>
68cdf0e10cSrcweir<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>
69cdf0e10cSrcweir<embed href="text/shared/00/00000004.xhp#related"/>
70cdf0e10cSrcweir<embed href="text/shared/guide/hyperlink_edit.xhp#hyperlink_edit"/>
71cdf0e10cSrcweir</body>
72cdf0e10cSrcweir</helpdocument>
73