Questions tagged «directory-index»

2
使用index.html的正确方法
我有很多问题想听听您的意见,所以希望我能尽力解释一下。我还应该指出,我的初学者只具备HTML和CSS的知识,因此尽管我几乎可以肯定有使用功能强大的PHP的简单解决方案,但对我没有帮助。 假设我的地址上有我的个人博客,example.com/blog.html并且有指向多个子博客的链接example.com/blog/math.html,example.com/blog/coding.html等等。所以我的根文件夹包含blog.html和blog文件夹,blog文件夹本身包含文件math.html和coding.html。 首先,我从Google Webmasters Tools那里了解到,出于SEO和美学目的,最好统一起来example.com.com并在来源中example.com/index.html添加_rel="canonical"_属性index.html。通过使用其他一些技巧(例如链接到../和./),我摆脱了index.html出现在我的网址中的难看内容。 现在,我想知道这种技巧是否不仅可以用于根文件夹,还可以用于任何文件夹?我的意思是,我会提出我blog.html到blog的文件夹,将其重命名为index.html和添加rel="canonical"统一example.com/blog/index.html使用example.com/blog/。 这个技巧会将我的博客地址从更改example.com/blog.html为example.com/blog/。 没做完!Google机器人索引我的文件夹时也遇到问题。因此,当我键入site:example.com/google搜索时,example.com/blog/其他结果中会出现指向我的文件夹的链接,其中包含原始文件,图标等。我猜还有其他方法可以解决它,但是恕我直言,上述更改也可以解决问题-Blog 文件夹中的index.html将使用户无法查看该文件夹的实际原始内容,只会出现example.com/blog/google搜索中的正确链接,并且(希望如此)_rel="canonical"_将使第二个不需要的链接example.com/blog/index.html不会出现在搜索结果中。 所以我的问题是: 将index.html文件放在每个子文件夹中还是一个好习惯,还是只打算放在根文件夹中? 使用第二种“ 在每个文件夹中建立索引 ”方法时,是否会出现任何不利条件或问题? 您希望使用上述两种网站结构中的哪一种方法?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.