2015-11-10 82 views
2

我克隆了聚合物起始剂套件,其工作非常好。聚合物路线不起作用聚合物起始剂套件

所以在占位符路由中有一个页面叫做 http://localhost:5000/users/Rob。 如果我通过单击rob链接从用户页面移动到Rob页面,上面的url有效。

但如果我直接粘贴在浏览器上的http://localhost:5000/users/Rob并按回车,它不起作用。

我认为上述可能会通过使用htaccess来解决。但无法弄清楚如何。

下面是我的.htaccess代码

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .* /index.html [L,R=302] 

回答

0

删除[L,R=302]奏效了我!

的.htaccess:

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .*/

的index.html:

<app-route 
route="{{route}}" 
pattern="https://stackoverflow.com/users/:id" 
data="{{usersRouteData}}" 
tail="{{usersSubroute}}" 
active="{{usersActive}}" 
></app-route>