﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-像一颗晨土-文章分类-pick up</title><link>http://www.blogjava.net/aichan/category/8883.html</link><description /><language>zh-cn</language><lastBuildDate>Fri, 02 Mar 2007 05:01:54 GMT</lastBuildDate><pubDate>Fri, 02 Mar 2007 05:01:54 GMT</pubDate><ttl>60</ttl><item><title>关于Web路径的备忘</title><link>http://www.blogjava.net/aichan/articles/37202.html</link><dc:creator>艾尘</dc:creator><author>艾尘</author><pubDate>Fri, 24 Mar 2006 05:47:00 GMT</pubDate><guid>http://www.blogjava.net/aichan/articles/37202.html</guid><wfw:comment>http://www.blogjava.net/aichan/comments/37202.html</wfw:comment><comments>http://www.blogjava.net/aichan/articles/37202.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/aichan/comments/commentRss/37202.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/aichan/services/trackbacks/37202.html</trackback:ping><description><![CDATA[<p>在处理Web页上一大堆连接的时候，常常被一些相对路径搞得很迷糊，现在整理一下，当作是提醒备忘。其实，很简单，只是老是不记住。呵</p>
<p>通常我们遇到的相对路径会有下面三种情况，下面一一来举例说明。</p>
<p>一、以&quot;/&quot;为首字母的路径，其完整路径将会是主机名加上该路径名<br />&lt;a href=&quot;/article/index.html&quot;&gt;article&lt;/a&gt;实际指向：<a href="http://hostname/article/index.html">http://hostname/article/index.html</a><br />二、无斜杠开头的路径，其完整路径将会是当前的URL的上一级路径加上该路径名<br />&lt;a href=&quot;article/index.html&quot;&gt;article&lt;/a&gt;，如果当前你访问的页面地址为<a href="http://hostname/book/list.html">http://hostname/book/list.html</a><br />则，这个连接将去到<a href="http://hostname/book/article/index.html">http://hostname/book/article/index.html</a><br />三、以一到N个.加斜杠开头的路径，其实整路径将会是当前的URL的上一级至N级路径加上该路径名，第二种情况是这种情况的特殊例子<br />&lt;a href=&quot;./article/index.html&quot;&gt;article&lt;/a&gt;，如果当前你访问的页面地址为<a href="http://hostname/book/list.html">http://hostname/book/list.html</a><br />则，这个连接将去到<a href="http://hostname/book/article/index.html">http://hostname/book/article/index.html</a><br />&lt;a href=&quot;../article/index.html&quot;&gt;article&lt;/a&gt;，如果当前你访问的页面地址为<a href="http://hostname/book/list.html">http://hostname/book/list.html</a><br />则，这个连接将去到<a href="http://hostname/article/index.html">http://hostname/article/index.html</a></p><img src ="http://www.blogjava.net/aichan/aggbug/37202.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/aichan/" target="_blank">艾尘</a> 2006-03-24 13:47 <a href="http://www.blogjava.net/aichan/articles/37202.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>