I am trying to get the following URL's:

mysite.com/folder/1/
mysite.com/anotherfolder/5/

To redirect to:
mysite.com/folder/index.php?a=1
mysite.com/anotherfolder/index.php?a=5

Current Code:

Code:
Options +FollowSymlinks
RewriteEngine on

RewriteRule ^folder/([0-9]+)/$ /folder/index.php?a=$1 [L]
RewriteRule ^anotherfolder/([0-9]+)/$ /anotherfolder/index.php?a=$1 [L]
The above code redirects to my the homepage of my site, whereas if I change the redirects to http://mysite.com/anotherfolder/index.php?a=$1 [L]

It does work but it actually redirects the user but I don't want to do that, I want to keep the URL friendly which is where I thought that the [L] would work.

Any ideas on how to fix this?