Regex Apache通过AliasMatch与WSGI进程一起提供单页应用程序

Regex Apache通过AliasMatch与WSGI进程一起提供单页应用程序,regex,apache,single-page-application,wsgi,npm-live-server,Regex,Apache,Single Page Application,Wsgi,Npm Live Server,我想将我的ApacheWeb服务器配置为既服务于单页应用程序,也服务于WSGI进程。我可以使用以下配置成功地在/api为WSGI应用程序提供服务: WSGIDaemonProcess myapp threads=5 user=apache WSGIScriptAlias /api /var/www/html/myapp/setup/myapp.wsgi 因此,如果用户点击/api/things,则会发送来自我的WSGI应用程序(flask)的JSON数据 我的主页index.html文件(当用

我想将我的ApacheWeb服务器配置为既服务于单页应用程序,也服务于WSGI进程。我可以使用以下配置成功地在
/api
为WSGI应用程序提供服务:

WSGIDaemonProcess myapp threads=5 user=apache
WSGIScriptAlias /api /var/www/html/myapp/setup/myapp.wsgi
因此,如果用户点击
/api/things
,则会发送来自我的WSGI应用程序(flask)的JSON数据

我的主页
index.html
文件(当用户点击
/
时提供)在包含以下内容时工作:

DocumentRoot /var/www/html/myapp/myappweb/public
但是,当用户访问任何不是以
/api
开头的路由时,我希望我的Apache web服务器能够提供
index.html
。例如,如果用户点击
/things
/things/42
,我希望Apache将它们发送到
index.html
,而不是抛出404。(我正在使用redux路由器处理客户端路径。)

我使用带有以下标志的node live server包在我的开发环境中实现了这一点:

live-server --entry-file=index.html
此外,我可以使用
AliasMatch
强制所有以
/things
开头的路由显示
index.html

AliasMatch "^/things(/.*)?$" /var/www/html/myapp/myappweb/public/index.html
但我真正想要的是一个
AliasMatch
regex,它强制所有路由显示
index.html

明白了吗

RewriteRule ^((?!\/[api|lib]).)*$ /var/www/html/myapp/myappweb/public/index.html
我需要排除
api
dir以及
lib
dir(我的js/css文件所在的位置)