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: 1002
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 example.com/blog.html and there are links to several sub-blogs example.com/blog/math.html, example.com/blog/coding.html 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 example.com.com and example.com/index.html 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 example.com/blog/index.html with example.com/blog/.
This trick would change the address of my blog from example.com/blog.html into example.com/blog/.
Not finished! I'm also experiencing problems with the google robot indexing my folders. So when I type site:example.com/ into the google search, the link to my folder example.com/blog/ 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 example.com/blog/ in the google search and (I hope that) _rel="canonical"_ would make the second, unwanted link example.com/blog/index.html not to appear in the search results.
So my questions are:
- Is it a good practice to have the
index.htmlfile in every subfolder or is it intended to be only in the root folder? - Are there any disadvantages or problems that may occur when using the second, "index in every folder" method?
- Which one of the two ways of structuring the website described above would you prefer?
© Pro Webmasters or respective owner