【问题标题】:Angular 4 on Apache in Subfolder子文件夹中 Apache 上的 Angular 4
【发布时间】:2018-06-16 06:20:09
【问题描述】:

大家好,

我的问题如下:

一开始我只有一个 Angular-App,所以我把它放到了我的 Apache 服务器的根文件夹中。我在 Apache 上的 404 重定向到 index.html 工作正常。

现在我有两个具有以下结构的 Angular-Apps:


--> App1(有自己的index.html)

--> App2(有自己的index.html)


如果我知道为 App1 (example.com/App1/invalidRoute/) 输入了无效的 URL,我的 Apache 网络服务器将重定向到根文件夹。

在这种情况下,我希望 Apache 重定向到“example.com/App1/index.html”。

提前致谢

【问题讨论】:

    标签: angular apache .htaccess


    【解决方案1】:

    看看这个 StackOverflow 问题: rewrite rules for apache 2 to use with angular js

    这同样适用于 Angular,如果你不使用 hash-urls,你可能需要在你的应用中设置一个匹配的基本路径。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-06-15
      • 1970-01-01
      • 1970-01-01
      • 2014-07-10
      • 2013-10-31
      • 2023-04-07
      • 1970-01-01
      相关资源
      最近更新 更多