如何在 Apache 上托管 Angular 4 多语言?

Dan*_*elZ 8 apache multilingual angular

我有一个同时使用英语和法语的网站。我使用以下命令来构建应用程序:

ng build --output-path=dist/fr --aot --prod --bh /fr/ --i18n-file=src/locale/messages.fr.xlf --i18n-format=xlf --locale=fr
ng build --output-path=dist/en --aot --prod --bh /en/
Run Code Online (Sandbox Code Playgroud)

我将enfr文件夹都复制到 Web 根目录。每个文件夹都有自己.htaccess的如下:

<IfModule mod_rewrite.c>
  Options Indexes FollowSymLinks
  RewriteEngine On
  RewriteBase /crisis-center/
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>
Run Code Online (Sandbox Code Playgroud)

我还在.htaccess网络根目录中添加了一个:

<IfModule mod_rewrite.c>
  Options Indexes FollowSymLinks
  RewriteEngine On
  RewriteBase /crisis-center/
  RewriteRule ^index\.html$ - [L]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d


  RewriteCond %{HTTP:Accept-Language} ^fr [NC]
  RewriteRule ^$ /fr/ [R]
  RewriteCond %{HTTP:Accept-Language} !^fr [NC]
  RewriteRule ^$ /en/ [R]
</IfModule>
Run Code Online (Sandbox Code Playgroud)

一切正常,除了一个问题:我无法刷新页面。它将显示 404 错误。我猜是因为.htaccess设置。

问题是什么?