Forum Moderators: phranque
Welcome to WebmasterWorld.
I am not sure what you mean by turns into? I recommend visiting the Apache Library [webmasterworld.com] and Forum Charter [webmasterworld.com] to get a better understanding of what mod_rewrite does.
There are a couple of corrections for your rule:
RewriteRule ^/([^.]+)\.(html?)$ /index.php?action=view&filename=$1.$2 [L]
The above will work for anything .htm or .html, but not .php to avoid looping.
The preceding / on the right side is required in the httpd.conf file.
If you are looking to show the rewrite to the users (redirect) you will need to add R=301, or R=30NUMBER to the L (last) flag at the end of the rule.
The L (last) flag will save you some processing -- generally should always be used unless you do not need it.
If you would like to define the regular expression, it is better to use [a-z0-9-] with the NC (No Case) flag added to the L flag on the rule than to add the A-Z set to the expression.
Hope this helps.
Justin