The problem is with the pattern, because there is no leading slash, see Per-directory Rewrites
Per-directory Rewrites
- ...
- The removed prefix always ends with a slash, meaning the matching occurs against a string which never has a leading slash. Therefore, a Pattern with ^/ never matches in per-directory context.
So to fix this remove the leading slash in your patterns
RewriteRule ^test/rest/mobile/list/$ /test/rest/RestController.php?view=all [NC,QSA]
RewriteRule ^test/rest/mobile/list/([0-9]+)/$ /test/rest/RestController.php?view=single&id=$1 [NC,QSA]
Unrelated, but you don't need RewriteBase
in this case, because you already use absolute substitution URLs.
Also, QSA|qsappend
is only needed, if you expect that the requests have a query string.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…