Forum Moderators: phranque

Message Too Old, No Replies

Linking to Directory instead of index file

         

riospace

8:59 am on Nov 18, 2006 (gmt 0)

10+ Year Member



I originally set my internal links to point to /directory/index.html files instead of /directory/

I later was under the impression that it is better to link to the directory instead of the file. I have since tried to change my links sitewide to do this. This has been a huge pain. I use Dreamweaver and it does not have this option (that I am aware of) so I have to be careful when linking to an index file to change it to /directory/ instead of /directory/index.html.

I have tried to sort out this mess and I am worried that I will now have some remaining (unintentionally) links that still link to /directory/index.html while most have been changed to /directory/

I then added the following redirect:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.(html?Šphp)\ HTTP/
RewriteRule ^(([^/]*/)*)index\.(html?Šphp)$ [www\.example\.com...] [R=301,L]

My question is was all of this worth it? Does it really matter if I link to the directory or the index file? It seemed much easier for me to simple link to the index file.

I also still have thousands of directories where I am still linking to the index.html file that I will need to individually go in and change all of the links to point to /directory/ and hope that I do not miss any. I think I might just be opening myself up to a duplicate problem if I miss anything when making these changes.

Should I just cut my loses and go back to linking to the index files?

If there is a better forum for this question, please move it. Thanks

riospace

2:03 pm on Nov 18, 2006 (gmt 0)

10+ Year Member



Also, all of my DMOZ listing point to index.htm. I am worried about that too.

Why is it better (if it really is) to link to the directory / instead of the file index.htm?

jonrichd

3:02 pm on Nov 18, 2006 (gmt 0)

10+ Year Member



I don't think it makes a bit of difference from a search engine's point of view whether you use /directory/ or /directory/index.html, as long as you are consistent in your naming of a given directory.

The only case where you might have a real benefit for the SEs in not using index.html would be for the root directory of your site, where example.com/ is better than example.com/index.html -- only because you will probably get external links to example.com.

There are benefits to using just the directory name from you and your user's point of view -- it's easier to type and remember just a directory name, and you as webmaster can change the underlying file type without having to go an rename links.

However, since you have set up your website using index.html, it's probably better to keep it that way, since the search engines have presumably found your files as they now are. If you rename everything to just /directory/, then these will be 'new files' to the search engines, and you might suffer from a loss in rankings, at least for a while.

martinibuster

8:55 pm on Nov 18, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



It doesn't really matter if all of your links point to the same file. However in the long term it may matter if you switch to a different web technology and your file names end up with an extension other than .html. This is not a problem if you're linking to directories.