Forum Moderators: phranque

Message Too Old, No Replies

redirect from index page to directory

redirect to directory

         

riospace

3:24 pm on Mar 10, 2007 (gmt 0)

10+ Year Member



I have an index.htm page on my website in a directory that all of my internal links are directed to.

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?

jdMorgan

3:35 pm on Mar 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want the search engines to list those pages as "/", then you have to link to <a href="/"> -- There is no way around that.

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