The second one contains an error. (Oops!)
The hyphen near the end should be the first character…
Code:
RewriteRule ^([-a-zA-Z0-9_]+)/?$ index.php?var=$1
The use of the var name
var may also be causing issues, as it may be a protected keyword. It's worth using another name for the parameter, just to be safe.
On the index.php, you'd access the parameters using
$_GET['paramName'] (
paramName being whatever name you use for the parameter.