【发布时间】:2012-11-05 20:51:42
【问题描述】:
我有以下html代码:
<div id="page">
<a class="topNavigationLink" href="http://MyOwnWebsite.com/">Home</a>
<a class="topNavigationLink" href="page1.html">page1</a>
<a class="topNavigationLink" href="page2.html">page2</a>
</div>
当我浏览到 www.MyOwnWebsite.com 然后单击导航链接时,一切正常。
但是,如果我浏览到 MYOWnWebsite.com(没有 www),然后尝试导航到其中一个页面,我会收到一个错误:
Firefox can't find the file at http://MyOWnWebsite.com/page1.html.
我做错了吗?处理 www.website.com 与 website.com 的正确方法是什么?
【问题讨论】:
-
这取决于您的服务器。您是否在服务器配置中设置了这两个位置?
-
我不确定。两者都有效(有 www 和没有 www),但导航变得混乱。如果我将 page1.html 更改为 www.mywebsite.com/page1.html 它会堆叠并尝试转到 mywebsite.com/www.mywebsite.com/mypage1.html
标签: html navigation no-www