【问题标题】:how to manage routing of 2 different angular apps in the same public_html folder如何在同一个 public_html 文件夹中管理 2 个不同的 Angular 应用程序的路由
【发布时间】:2022-01-14 06:18:48
【问题描述】:

我在同一目录中有 2 个 Angular 应用程序 (public_html) 一个是主应用程序,它有自己的路线。 第二个是主应用程序内的文件夹,其中也有路线。 当我想导航到秒应用程序中的路线以及尝试用户返回主应用程序时,我遇到了问题。

有没有办法解决这个问题?也许用 htaccess?

【问题讨论】:

    标签: angular routes public-html


    【解决方案1】:

    解决方案是在第二个应用程序 htaccess 中添加以下内容:

    RewriteEngine On
    # For existing assets or directories, no redirection is required
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
    RewriteRule ^ - [L]
    # if the requested resource doesn't exist, use index.html
    RewriteRule ^ ./index.html
    RewriteRule ^(.*) /invited/index.html [NC,L]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-09-14
      • 1970-01-01
      • 2020-09-16
      • 2019-07-28
      • 1970-01-01
      • 2016-03-25
      • 1970-01-01
      相关资源
      最近更新 更多