3
我开发了一个简单的应用程序,遵循angular 2 quickstart。它在lite-server中正确运行。 现在我尝试运行安装在htdocs/foo下的apache中的相同的应用程序,但刷新后,我得到“未找到对象”。角2找不到刷新路线
baseHref
的index.html:
<base href="/foo">
路由
app.rounting.ts:
const appRoutes: Routes = [
{
path: 'sched',
component: ScheduleFormComponent
},
{
path: 'dashboard',
component: DashboardComponent
},
{
path: '',
redirectTo: '/home',
pathMatch: 'full'
},
{
path: 'home',
component: HomeComponent
},
{
path: 'sched-detail/:id',
component: ConsultationDetailComponent
}
];
我还添加使用
<ifModule mod_rewrite.c>
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.html
</ifModule>
的的.htaccess
但仍然没有运气。
在apache配置中是否存在缺少的东西?
谢谢!这解决了我的问题。 – carloliwanag
超级!乐意效劳! –