我知道在重新加载/刷新后我需要一个.htaccess
文件来重定向我的AngularJS应用程序,而不是获得404。
我正在使用 AngularJS 1.5.7
我的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]
在.htaccess
中我已经摆脱了404,但在刷新页面之后,角度不再呈现HTML了。还尝试了不同版本的rewriteconditions
在我的app配置中,我正在使用:
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
我无法自己发现错误。 任何帮助都将非常感激。