HTML区分大小写问题 [英] HTML case sensitive issue

查看:86
本文介绍了HTML区分大小写问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能存在重复:

HTML区分大小写问题


我有这个:

 < div class =menuHolder> 
< nav class =menu>
< ul id =menu>
< li class =with_ul>< a id =panorama>< span class =overPlane>< / span>< span class =mText>全景< ; /跨度>< / A>
< ul class =submenu_1>
< li>< a href =abc.html>测试< / a>< / li>
< li>< a href =#!/ pageMore>个人资料< / a>< / li>
< li>< a href =#!/ pageMore>历史记录< / a>< / li>
< / ul>
< / li>
< / ul>
< / nav>
< / div>

我已经有一个名为aBc.html的文件了

当我点击Test时,我得到了404。如果我将该行更改为

 < li>< a href =aBc.html>测试< / a>< / li> 

它可以正常工作。



我知道HTML不区分大小写,但为什么会发生这种情况?我做错了什么?

解决方案

URL通过域名区分大小写。 example.com EXAMPLE.COM 都解析为相同的地址,但域名后面的任何内容区分大小写。



现在来到文件系统。 Windows使用不区分大小写的NTFS,因此 abc.html aBc.html 引用同一个文件。大多数Linux发行版使用区分大小写的EXT4,因此 abc.html aBc.html 是两个不同的文件。
$ b

总之,你的web服务器运行在一个文件系统,其中的文件名是区分大小写的,所以 abc.html aBc.html 引用两个不同的文件。


Possible Duplicate:
HTML Case Sensitive Issues

I have this:

<div class="menuHolder">
  <nav class="menu">
    <ul id="menu">
      <li class="with_ul"><a id="panorama"><span class="overPlane"></span><span class="mText">panorama</span></a>
        <ul class="submenu_1">
          <li><a href="abc.html">Test</a></li>
          <li><a href="#!/pageMore">Profile</a></li>
          <li><a href="#!/pageMore">History</a></li>
        </ul>
      </li>
    </ul>
  </nav>
</div>

I have a file called aBc.html already

When I clicked on Test, I get a 404. If I change the line to

<li><a href="aBc.html">Test</a></li>

it works fine.

I know that HTML is not case sensitive, but then why is this happening? Did I do anything wrong?

解决方案

A URL is case-sensitive past the domain name. example.com and EXAMPLE.COM both resolve to the same address, but anything after the domain name is case-sensitive.

Now come the filesystems. Windows uses NTFS, which is not case-sensitive, so abc.html and aBc.html refer to the same file. Most Linux distros use EXT4, which is case-sensitive, so abc.html and aBc.html are two different files.

In short, your webserver is running on a filesystem where filenames are case-sensitive, so abc.html and aBc.html refer to two different files.

这篇关于HTML区分大小写问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆