MENU service case
 Website construction website design Beijing website construction high-end website production company Shangpin China
We create by embracing change
360 ° brand value__
simplified Chinese character
Simplified Chinese English

Shangpin China Joins Hands with Beisheng Internet to Create a New Chapter in Website Construction

Type: Shangpin Dynamic Learn more

What are the absolute path and relative path of website hyperlink

Source: Shangpin China | Type: website encyclopedia | Time: July 22, 2015
Understanding the file path from the document that is the starting point of the link to the document that is the target of the link is critical to creating the link. each Enterprise website construction Web pages have a unique address, called a Uniform Resource Locator (URL). However, when creating a local link (that is, a link from a document to another document on the same site), you usually do not specify the full URL of the document that is the target of the link, but specify a relative path starting from the current document or the root folder of the site. There are three types of link paths.

1. Absolute path

Provide the full URL of the linked document, and include the protocol used (for example, for Web pages, usually //), such as //ihucc.com/ , as shown in Figure 2-38.
 Create absolute path

You must use an absolute path to link to documents on other servers. Absolute path links can also be used for local links (that is, links to documents in the same site), but this is not recommended, because once this site is moved to another domain, all local absolute path links will be broken. By using relative paths for local links, you can also increase flexibility when you need to move files within the site.

Note: When inserting an image (not a link), you can use the absolute path to the image on the remote server (an image that is not available on the local hard drive).

2. Document relative path

For an overall Web site, the document relative path is usually the most appropriate path. The document relative path can also be used to link to the web page files in other folders by using the folder hierarchy to specify the path from the current document to the linked document. The basic idea of document relative path is to omit the absolute path part that is the same for the current document and the linked document, and only provide different path parts. Assume that the structure of a site is shown in Figure 2-39. To link from contents.html to hours.html (two files are in the same folder), you can use the relative path hours.html To link to tips.html (in the resources subfolder), you can use the relative path resources/tips.html. Every occurrence of/ A slash means to move down one level in the folder hierarchy.
 Site Structure
To link to index.html (one level above contents.html in the parent folder), you can use the relative path/ index.html。 Each occurrence of a two/slash indicates that the folder is moved up one level in the folder hierarchy. To link to catalog.html (located in other subfolders of the parent folder), use the relative path/ Produc/catalog.html。 Where/ Move up to the parent folder and products/down to the products subfolder.

At this time, when the user moves the entire site folder (such as My_site) to another disk (such as moving from disk E to disk F), all files in the folder remain the same relative path to each other. At this time, there is no need to update the document relative links between these files. However, when you move a single file that contains or is targeted by document relative links, you must update those links.

3. Site root directory relative path

The relative path of the site root directory refers to the path from the root folder of the site to the document. If you are dealing with a large Web site that uses multiple servers, or if you are using a server that hosts multiple sites, you may need to use these paths. However, if you are not familiar with this type of path, it is better to stick to the document relative path.

The relative path of the site root directory starts with a forward slash, which represents the site root folder. For example,/supportltips.html is the site root directory relative path of the file (tips. html), which is located in the site root folder
In the support subfolder of the.

If you need to frequently move HTML files between different folders on your Web site, the relative path of the site root directory is usually the best way to specify links. When you move a document that contains relative links to the site root directory, you do not need to change these links.

However, if you move or rename the documents pointed to by the relative links of the site root directory, you must update these links even if the relative paths between the documents have not changed. For example, if you move a folder, you must update all site root relative links to files in the folder.
Source Statement: This article is original or edited by Shangpin China's editors. If it needs to be reproduced, please indicate that it is from Shangpin China. The above contents (including pictures and words) are from the Internet. If there is any infringement, please contact us in time (010-60259772).
TAG label:

What if your website can increase the number of conversions and improve customer satisfaction?

Make an appointment with a professional consultant to communicate!

* Shangpin professional consultant will contact you as soon as possible

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]

Communicate with professional consultants now!

  • National Service Hotline

    400-700-4979

  • Beijing Service Hotline

    010-60259772

Please be assured to fill in the information protection
Online consultation

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]