我有以下的html代码:HTML导航错误。如何处理www.website.com与website.com?在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的正确方法?
这取决于您的服务器。您是否在服务器配置上设置了两个位置? – Ibu
我不确定。这两个工作(与www和没有),但导航变得棘手。 如果我将page1.html更改为www.mywebsite.com/page1.html,它会堆叠并尝试去mywebsite.com/www.mywebsite.com/mypage1。html –