Search engine spiders know how to follow redirects... they should be able to index the proper version.
However, I'd recommend not using redirects. Why not just serve up the different versions without a redirect? A redirect is totally unneccesary here. Instead of outputing a Location header, just output the appropriate version of the web page. Google has said that this type of "cloaking" is fine with them.
However, serving a special version for Googlebot (or other spiders) could get you penalized.
Thanks for that. I'd always assumed (wrongly it seems) that search engines could follow 301 redirects but not when the redirect is made using (for example) a PHP script with Location header.
My reason for using index pages in different directories was that I wanted to find a way to maintain the visitors language on all pages throughout the visit without using session variables. My script extracts the country from the URI on each page and serves the language accordingly.
However, if search engines can follow a Location header redirect then presumably, this won't be a problem for me?