Я хочу запустить приложение Angular на сервере Apache в подкаталоге. Я попробовал эту конфигурацию в файл .htaccess:
<IfModule mod_rewrite.c>
Options Indexes FollowSymLinks
RewriteEngine On
RewriteBase /admin/
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.html [L]
</IfModule>
Я изменил в index.html эту строку <base href="/admin/">
Но я получаю эту ошибку на одной из страниц:
Error: Uncaught (in promise): HttpErrorResponse: {"headers":{"normalizedNames":{},"lazyUpdate":null},"status":200,"statusText":"OK","url":"http://123.123.123.123/admin/api/transaction_notes/unique_id/54","ok":false,"name":"HttpErrorResponse","message":"Http failure during parsing for http://123.123.123.123/admin/api/transaction_notes/unique_id/54","error":{"error":{},"text":"
<!doctype html>\n
<html lang=\ "en\">\n
<head>\n
<meta charset=\ "utf-8\">\n
<title>Ui</title>\n
<base href=\ "/admin/\">\n\n
<meta name=\ "viewport\" content=\ "width=device-width, initial-scale=1\">\n
<link rel=\ "icon\" type=\ "image/x-icon\" href=\ "favicon.ico\">\n\n
<link href=\ "//netdna.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css\" rel=\ "stylesheet\" />\n
<script src=\ "https://code.jquery.com/jquery-3.3.1.slim.min.js\" integrity=\ "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo\" crossorigin=\ "anonymous\"></script>\n
<script src=\ "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js\" integrity=\ "sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49\" crossorigin=\ "anonymous\"></script>\n
<script src=\ "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js\" integrity=\ "sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy\" crossorigin=\ "anonymous\"></script>\n
<script src=\ "https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.3/Chart.bundle.min.js\"></script>\n\n</head>\n
<body class=\ "menu-position-side menu-side-left with-content-panel\">\n
<app-root></app-root>\n
<script type=\ "text/javascript\" src=\ "runtime.js\"></script>
<script type=\ "text/javascript\" src=\ "polyfills.js\"></script>
<script type=\ "text/javascript\" src=\ "styles.js\"></script>
<script type=\ "text/javascript\" src=\ "scripts.js\"></script>
<script type=\ "text/javascript\" src=\ "vendor.js\"></script>
<script type=\ "text/javascript\" src=\ "main.js\"></script>
</body>\n
</html>\n"}}