Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

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
share|improve this answer
    
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? –  guisasso Oct 26 '12 at 17:29
    
+1 for the "It looks ugly as hell" –  Tom Sarduy Oct 26 '12 at 18:14
    
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. –  The Disintegrator Oct 26 '12 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 '12 at 4:45
    
You always can do site.com/blog/123 –  The Disintegrator Nov 6 '12 at 1:42
add comment

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.

share|improve this answer
    
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? –  guisasso Oct 26 '12 at 17:51
    
As an update, index.html is definitely accessible, but i never link to it. –  guisasso Oct 26 '12 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 –  w3d Oct 26 '12 at 18:22
    
Thank you very much. –  guisasso Oct 26 '12 at 18:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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