生产与开发API调用重定向到前端



我知道这是非常模糊的,但希望我能更新它,以便在人们提问时足够了。

我们有一个DEV和PROD apache服务器。我们简单的get API调用在PROD中工作。您调用API,返回数据(以json格式(。

现在我们的DEV服务器具有相同的Apache配置和相同的重写条件,但是当调用DEV API时,用户会被重定向到前端应用程序(以角度编写(。

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} /api/.* [OR]
#L(ast) flag, if this rule is used stop the rewriting process immediately and don't apply any more rules
RewriteRule ^ - [L] #for all matching, pass the existing path through unmodified
# If above rule did not direct to an existing document, default to index.html
RewriteRule ^ /index.html

由于apache配置文件是相同的,我很困惑为什么用户在DEV中被重定向。我希望DEV中的API调用以类似PROD的json格式返回数据。

路由必须从一台服务器更改为另一台

最新更新