Apache TOME RewriteCond匹配所有路径不相等模式

Apache TOME RewriteCond匹配所有路径不相等模式,apache,apache-tomee,Apache,Apache Tomee,我有一个问题: 应用程序和特定后端被打包在同一个maven模块中,上下文为/test/。后端的REST api位于/test/api/*,但所有与此路径不匹配的其他请求都应重定向到/test/index.html。我的重写条件如下所示: RewriteCond %{REQUEST_PATH} !^/test/api/* RewriteRule ^/test/(.*) /test/index.html 但这不起作用,我做错了什么

我有一个问题:

应用程序和特定后端被打包在同一个maven模块中,上下文为
/test/
。后端的REST api位于
/test/api/*
,但所有与此路径不匹配的其他请求都应重定向到
/test/index.html
。我的重写条件如下所示:

RewriteCond %{REQUEST_PATH} !^/test/api/*
RewriteRule ^/test/(.*) /test/index.html
但这不起作用,我做错了什么