Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 不通向组件的角链接_Angular_Web_Apache2 - Fatal编程技术网

Angular 不通向组件的角链接

Angular 不通向组件的角链接,angular,web,apache2,Angular,Web,Apache2,我目前正在使用角度路由器进行内部链接: const routes: Routes = [ { path: '', component: HomeComponent }, { path: 'register', component: RegisterComponent }, { path: 'imprint', component: ImprintComponent } .... ]; 作为Web服务器,我在Debian服务器上使用Apache2 我的问题是

我目前正在使用角度路由器进行内部链接:

    const routes: Routes = [
    { path: '', component: HomeComponent },
    { path: 'register', component: RegisterComponent },
    { path: 'imprint', component: ImprintComponent } ....
   ];
作为Web服务器,我在Debian服务器上使用Apache2


我的问题是,当我访问例如
mydomain.com/imprint
时,它不会导致内部链接。我得到一个404错误页面。如何修复此问题?

由于web服务器正在查找名为“imprint”的文件夹,因此您将获得404。最好的选择是使用HashLocationStrategy。这一页很好地解释了这一点:


由于web服务器正在查找一个名为“imprint”的文件夹,因此您会得到一个404。最好的选择是使用HashLocationStrategy。这一页很好地解释了这一点:


当mydomain.com处于链接状态时发生了什么?你的意思是什么?我的意思是当你试图只使用域打开页面时发生了什么?当mydomain.com处于链接状态时发生了什么?你的意思是什么?我的意思是当你试图只使用域打开页面时发生了什么?