---
title: "html中链接url到根目录，或上级目录"
author: "kooyee"
date: "2010-07-19T14:25:24Z"
tags: []
categories: ["Web前端"]
slug: "html-url"
draft: false
lastmod: "2010-07-19T19:33:39Z"
id: 716024
url: "https://kooyee.iteye.com/blog/716024"
---

1\. 用网站的域名就可以了,如: "../../../index.htm" 变为: 127.0.0.1/index.htm

 

2\. 用代码(asp页面):

```
local_path=Request.SeverVariables("local_addr")
path=local_path & "/index.htm" 
```

 

用绝对路径， 从根目录下的全路径（href=“/cmd/”, 指向到根目录下的cmd文件夹）

 

...