【发布时间】:2019-10-16 02:49:06
【问题描述】:
我的 Angular 应用程序 7.1.4 在 apache 2.4.10 服务器上运行。我使用PathLocationStrategy 来路由我的网址。
这里是我的 index.html 文件的一瞥
<meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta http-equiv="Cache-control" content="no-cache, no-store, must-revalidate"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Expires" content="0" /> <title>Intranet</title> <base href="/">
.htaccess 文件
选项 +FollowSymlinks
重写引擎开启
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
重写规则 ^ - [L]
重写规则 ^ /index.html [L]
问题是,如果我的网址看起来像
http://intranet.company.com/app/myspace?id=favorites
Apache 重定向到
http://intranet.company.com/index.html?id=favorites
我的目标页面没有显示。
知道我的 URL 都以 BASE_URI/app/... 开头,我该如何解决这个问题
【问题讨论】:
标签: mod-rewrite url-rewriting angular7 apache2.4 angular7-router