Your fourth rule is correct for the stated purpose if the code is located in httpd.conf or conf.d.
If this code is for .htaccess, be aware that the path to the current .htaccess directory is always stripped from the URL-path examined by RewriteRule -- i.e. the path is "localized" to the .htaccess file's directory. So, if this is the case, you'll need to remove the leading slash from the RewriteRule pattern.
Using "." as a separator will work, as long as no RewriteRules are looking for the "." and treating what follows as a filetype, and as long as you don't have MultiViews (content negotiation) enabled, which would also treat the periods as filetype separators. (For this application, I would suggest using a hyphen or an underscore, just to 'future-proof' your URLs in case you do someday want to use either of these techniques.)
If you still wish to use a period as a separator, then you will also need to explicitly prevent the rewritten request for "index.php?name=firstname.lastname" from being subsequently rewritten to /index.php?name=index.php repeatedly -- in an 'infinite' rewrite loop. Typically, you could do this by adding a RewriteCond.