我用 $ locationProvider.html5Mode(真);从网址中删除#
http://seagullinteractive.com/#/about: - 重新加载后工作 至 http://seagullinteractive.com/about: - 它不起作用现在不是问题
答案 0 :(得分:1)
您需要在根目录中创建.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]
需要提出以上重写规则。那就没事了。当您拨打http://seagullinteractive.com/about时,您的服务器将查找名称为#34;"的目录。实际上不存在,结果你会得到404。如果在具有请求URI的服务器上找不到资源,则需要重定向到index.html(或包含ng-app的页面)。