The right way of using index.html

Posted by Jeyekomon on Pro Webmasters See other posts from Pro Webmasters or by Jeyekomon
Published on 2012-05-28T19:08:04Z Indexed on 2012/06/01 22:51 UTC
Read the original article Hit count: 756

Filed under:

I have quite a lot of issues I'd like to hear your opinion on, so I hope I'll manage to explain it well enough. I should also note that I'm beginner equipped only with the knowledge of HTML and CSS so although I'm almost sure that there is a simple solution using powerful PHP, it won't help me.

Let's say that I have my personal blog on the address and there are links to several sub-blogs, etc. So my root folder contains blog.html and blog folder, the blog folder itself contains files math.html and coding.html.

First of all, I learned (from Google Webmasters Tools) that for SEO and aesthetical purposes it's good to unify and by adding _rel="canonical"_ attribute into the source of the index.html. Using a couple of other tricks (like linking to ../ and ./) I got rid of the ugly index.html appearing in my web addresses.

And now I wonder if this trick can be used not only for the root folder but for any folder? I mean, I would move my blog.html into the blog folder, rename it into the index.html and add rel="canonical" to unify with
This trick would change the address of my blog from into

Not finished! I'm also experiencing problems with the google robot indexing my folders. So when I type into the google search, the link to my folder with raw files, icons etc. appears among the other results. I guess there are also other ways how to fix it, but IMHO the change mentioned above would do the trick too - the index.html in the blog folder would preserve the user from viewing the actual raw content of that folder, there would appear only the right link in the google search and (I hope that) _rel="canonical"_ would make the second, unwanted link not to appear in the search results.

So my questions are:

  1. Is it a good practice to have the index.html file in every subfolder or is it intended to be only in the root folder?
  2. Are there any disadvantages or problems that may occur when using the second, "index in every folder" method?
  3. Which one of the two ways of structuring the website described above would you prefer?

© Pro Webmasters or respective owner

Related posts about seo

Related posts about html