重写AngularJS网址重写、网址、AngularJS

由网友(迷鹿了i)分享简介:如何在AngularJS网站的URL自动从 example.com/app 改写为 example.com/app /#/ ?How can an AngularJS site's url be automatically rewritten from example.com/app to example.com/a...

如何在AngularJS网站的URL自动从 example.com/app 改写为 example.com/app /#/

How can an AngularJS site's url be automatically rewritten from example.com/app to example.com/app/#/?

目前,从 example.com/app 更改为 example.com/app#/

推荐答案

您可以使用此规则:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?[^/])$ /$1/#/ [L,NE,R=302]