I dont understand what you mean when you say to use the !-f test to prevent looping on folder/index.php?
That's simply one way to escape from the loop you're generating with the inappropriate use of (.*), i.e., test whether the file exists before redirecting back to it with your LOOPY code.
[standard rant #1]
The use of "lazy regex," specifically the

EVERYTHING

atom, (.*), and its close relatives, is the NUMBER ONE coding error of newbies BECAUSE it is "greedy." Unless you provide an "exit" from your redirection, you will ALWAYS end up in a loop!
[/standard rant #1]
From your notes above i gather that the below should work then on apache 1 and 2 server, but i should change the (.*)?
WRONG! In the RewriteRule, the slash is required (in the DocumentRoot) by Apache 1.x servers following the start anchor, i.e., ^/... Apache 2.x assumes that there is a / following the domain name so it will NOT match ^/, it will only match ^. If you don't know which version of Apache you're using (then shame on you), you can use ^/? as that's accepted by both versions of Apache.
[code]RewriteRule ^/folder/(.*)$ /folder/index.php?param=$1 [R=301,L][\code]
As explained above, there are two problems with this (if using Apache 2.x): The leading / and the simple fact that (.*) will match the redirection (index.php) and loop. Since you're not locking up the server with your loop, you can assume that you're using an Apache 2.x server (it'll make 10 attempts before giving up but it won't lock-up the server and require a restart).
I have tried about 6 different .htaccess code generators all with no luck. There is clearly something fundamental i am doing wrong here but i still cant figure out what?
Forgive me for stating the obvious: If you don't know what you're doing, it's likely that you're not inputting good information to the code generators (which MUST make some assumptions - I know! I created a mod_rewrite generator and it's not a trivial exercise). It would be far simpler for you to spend a few minutes with a tutorial (like the one linked below) which lays it all out for you and has helped many members learn about mod_rewrite over the several years it's been online.
Bookmarks