Angularjs 角度html5模式在apache中不起作用

Angularjs 角度html5模式在apache中不起作用,angularjs,apache,.htaccess,Angularjs,Apache,.htaccess,我有一个带文件夹结构的有角度的应用程序 app --app.js controllers --controller.js services --services.js css img index.html .htaccess 我的index.html <base href="/"> 一切都很顺利 现在我想改成这个文件夹结构 public --app --app.js --controllers --services --css --img -

我有一个带文件夹结构的有角度的应用程序

app
 --app.js
controllers
 --controller.js
services
 --services.js
css
img
index.html
.htaccess
我的index.html

<base href="/">
一切都很顺利

现在我想改成这个文件夹结构

public
  --app
    --app.js
  --controllers
  --services
  --css
  --img
  --index.html
.htaccess
我已将index.html基更改为

<base href="/public/">

现在html5模式不起作用了,但如果我关闭html5模式,应用程序就会工作……我做错了什么?

也许你的HREF需要加上“public/”前缀?我的HREF没问题,所有文件都已正确加载,但出现js错误
angular.js:11651uncaughttypeerror:无法读取未定义的属性“replace”
它与ui路由器有关
<base href="/public/">
DirectoryIndex public/index.html

RewriteEngine On
RewriteBase /public/

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^ index.html [L]