In fact I am working on a small php script, and now I am struggling with doing redirect using mod-rewrite.
What i want is to redirect 

```
www.xx.com/motivational/api.php?latest=1 

```

to

```
www.xx.com/api.php?latest=1&app=motivational

```

I tried this but it doesn't work:

```
RewriteRule ^/motivational/api\.php$ /api.php?latest=&%{QUERY_STRING}

```