2

I had an angular app with this folder strucure

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

my index.html had

<base href="/">

and my .htaccess

RewriteEngine On

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

    RewriteRule ^ index.html [L]

And everything worked fine

Now I want to change to this folder structure

public
  --app
    --app.js
  --controllers
  --services
  --css
  --img
  --index.html
.htaccess

I've changed to index.html base to

<base href="/public/">

and my .htaccess to

DirectoryIndex public/index.html

RewriteEngine On
RewriteBase /public/

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

And now html5 mode is not working, though if I turn off html5 mode the app works...What am I doing wrong?

Diego Vega
  • 223
  • 6
  • 16
  • maybe your hrefs need 'public/' prepended to it? – user3791775 Jul 01 '16 at 21:32
  • my hrefs are ok, all the files are loaded properly but it got a js error `angular.js:11651Uncaught TypeError: Cannot read property 'replace' of undefined` – Diego Vega Jul 01 '16 at 21:35
  • 1
    http://stackoverflow.com/questions/29261782/typeerror-cannot-read-property-replace-of-undefined It has something to do with ui-router – user3791775 Jul 01 '16 at 21:39

0 Answers0