【发布时间】:2019-02-11 17:55:51
【问题描述】:
我正在使用 Angular 6。我的应用程序在本地运行良好。我已经使用ng build 构建了代码。我正在使用 Ubuntu 服务器。我已将代码上传到服务器,页面也正在加载。
但是当我刷新页面时,我收到以下错误。
您要查找的资源已被删除、更改名称或暂时不可用。
我已经粘贴了我的 index.html 代码。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>WAF</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="icon" type="image/x-icon" href="assets/images/favicon.png">
</head>
<body>
<app-root></app-root>
</body>
</html>
并且也尝试过使用 .htaccess 文件。遇到同样的问题。
RewriteEngine On
Options FollowSymLinks
RewriteBase /
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} ^/(.*)$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /#/$1 [L]
请帮我解决这个问题。 谢谢
【问题讨论】:
标签: angular