Forum Moderators: phranque
I would like all of the links to point to:
http://www.example.com/directory
instead of:
http://www.example.com/directory/index.htm
I was going to do a find and replace sitewide, but it was not possible because the links were all relative (ex. ../../../index.htm) to the document and I have hundreds of index.htm pages on my site.
Is there an easy search engine friendly way to do this for this directory only or is this a bad idea?
Once you've changed all of your links, you can use mod_rewrite to externally redirect requests for the old link "/index.html" back to "/" in order to prevent "/index.html" from getting listed again in search engines due to other sites linking to the old URL. But you still need to change your links to avoid problems with search engines and site performance (For example, if you redirect on every request, then the time required to start loading the page content essentially doubles).
There are several multi-file search and replace utilities available free on the Web -- you can find them with a search.
Jim