after i use lazy loading in my angular projects, it works well in local host but the problem is : when i upload project on server if users write URL just like www.oceanweb.ir and then click on contact us button they will direct to contact us page "www.oceanweb.ir/contact-us" correctly but if they enter same URL (www.oceanweb.ir/contact-us) by them self and write it in address bar an error will occur
(在我的有角项目中使用延迟加载后,它在本地主机上运行良好,但是问题是:当我在服务器上上传项目时,如果用户像www.oceanweb.ir一样写URL,然后单击“与我们联系”按钮,他们将直接联系我们页面“ www.oceanweb.ir/contact-us”正确,但是如果他们自己输入相同的URL(www.oceanweb.ir/contact-us)并将其写入地址栏中,则会发生错误)
Not Found The requested URL was not found on this server.
(找不到在此服务器上找不到请求的URL。)
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
(此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误。)
here is part of my routing file
(这是我的路由文件的一部分)
const routes: Routes = [
{
path: "",
component: LandingPageComponent
},
{
path: "template",
component: TemplateLayoutComponent,loadChildren: "./dashboard/template/template.module#TemplateModule"
},
{
path: "contact-us",
component: ContactUsLayoutComponent,loadChildren: "./dashboard/contact-us/contact-us.module#ContactUsModule"
},
{
path: "education",
component: EduLayoutComponent,loadChildren: "./dashboard/education/education.module#EducationModule"
},
{
path: "recruitment",
component: ReqLayoutComponent,loadChildren: "./dashboard/recruitment/recruitment.module#RecruitmentModule"
}
];
ask by amir marjani translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…