网站打开正常,我能够顺利地浏览到不同的页面。然而,当我打开主页并按下刷新按钮时,网站就会中断,并返回以下信息。
{"seek":"21598","duration":"1:00:08"}
我不知道是什么原因。因为其他页面都不是这样的。
您可以通过点击查看网站 这里
我的app-routing如下。
const routes: Routes = [
{path: '', redirectTo: '/home', pathMatch: 'full'},
{path: 'home', component: HomeComponent},
*** Other Routing
{path: '**', redirectTo: '/home', pathMatch: 'full'}
];
我的.htaccess文件如下:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /index.html [NC,L]
你是否检查了你的Apache .htaccess
配置?
我不认为这是一个Angular路由问题。它似乎是服务器导航的问题,因为它正在返回301代码。你可以通过打开网络选项卡上的Dev工具并进行刷新来检查。它重定向到home,并在那里得到一些价值。