This is .htaccess file I currently have:

```
Options -Indexes
AddDefaultCharset utf-8
ErrorDocument 403 /error.html
ErrorDocument 404 /error.html
<Files ".ht*">
    Require all granted
</Files>
RewriteEngine on
RewriteRule ^error\.html$ / [R=301]
RewriteRule ^\.ht / [L,R=301,NC]

```

I need to add a specific rule to map a non-existent file to a script, like so:

```
RewriteRule /folder/file.txt /folder/file.php [L]

```

How do I add this rule to the .htaccess?

I tried:

```
Options -Indexes
AddDefaultCharset utf-8
ErrorDocument 403 /error.html
ErrorDocument 404 /error.html
<Files ".ht*">
    Require all granted
</Files>
RewriteEngine on

RewriteCond "%{REDIRECT_URL}" "/folder/file.txt"
RewriteRule ^error\.html$ /folder/file.php [L]

RewriteRule ^error\.html$ / [R=301]
RewriteRule ^\.ht / [L,R=301,NC]

```

but it doesn't work.

Thank you!