Is there a difference between linking to www.example.com/site/index.html and www.example.com/site/ since it'll point to the same page? I point everything i can to a folder on my website, i just think it looks better when the browser doesn't display the name of the file. Is this wrong, right, good or bad?

2 Answers 2


It's better to link to the folder

  • If sometimes you link to www.example.com/site/index.html and other times to www.example.com/site/ you will end up with a spitted pagerank

If you link to a page instead of a folder

  • It's harder to remember. (was it www.example.com/contact or www.example.com/contactUs.html?)
  • It looks ugly as hell
  • You are exposing the technology behind the page (index.php, index.asp, etc) and if later you decide to switch you will have a hell of a time mapping the old urls to the new ones
  • Thanks. My usage was only based on what you specified as "ugly as hell", and i share definitely that thought! I just didn't know if perhaps on a SEO point of view it was a bad practice. Any thoughts on that? Oct 26, 2012 at 17:29
  • With the spited pagerang I was referring to the SEO. For the user it will be the same. But for the crawlers, they're two different pages. Oct 26, 2012 at 19:38
  • Well here's my question: Say your page uses URL parameters. Couldn't it be considered more ugly to use a file-less URL in those cases? For example, site.com/blog/?id=123 Looks a lot worse to me than site.com/blog/index.php?id=123 (That might just be because I'm conditioned to seeing a file go along with parameters.)
    – NessDan
    Nov 4, 2012 at 4:45
  • You always can do site.com/blog/123 Nov 6, 2012 at 1:42

www.example.com/site/index.html and www.example.com/site/

Pointing to the bare directory, without the directory index, is prefered.

Although the same content might be displayed on your server, these are different URLs. Search engines will see these two URLs as different and might perceive this as duplicate content if both these URLs are used on your site, or in-bound links go to both. Only "www.example.com/site/" should be used (it's cleaner) and ".../index.html" should redirect to ".../". The actual file returned when you request "www.example.com/site/" is dependent on your server and the value of the DirectoryIndex directive (Apache). It could be anything you like, not necessarily "index.html".

From an SEO point of view it is only "bad" if you mix the two and both are accessible.

  • So you're saying i should redirect /index.html to / ? Wouldn't that create some sort of bug since / finds the index of the folder automatically? If i should redirect, where, on .htaccess? Oct 26, 2012 at 17:51
  • As an update, index.html is definitely accessible, but i never link to it. Oct 26, 2012 at 18:00
  • Yes, you certainly have to be careful about a redirect loop in this instance. See my answer on this thread for example code: webmasters.stackexchange.com/a/35099/1243
    – MrWhite
    Oct 26, 2012 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.