0

So I am trying to understand angular's routing/address rewriting behaviour logic when I hit a page's address directly i.e. go to index.html instread of just'/'.

(You might question why I am doing that. Its because I am trying to use Angularjs in an unusual context where hitting the page by its full address directly is unavoidable and when I do that the routing gets weird.)

//If I hit:
http://localhost/
//everything works fine all - address bar rewrites to http://localhost/#/authenticate
//window.location == http://localhost/ 

//If I hit:
http://localhost/index.html //I know, I know, I need to do it this way
//page address gets re-written as http://localhost/index.html#/index.html
//nothing works fine none of the routing happens
//window.location == http://localhost/index.html 

Any insights?

Scott Wright
  • 186
  • 1
  • 11
  • Sorry I'm not totally clear on the question but if you go here: view-source:http://code.angularjs.org/1.1.5/angular.js line 7847 it appears to have the definition of when and otherwise after that for the route provider it may help. – shaunhusain Jul 15 '13 at 19:57

1 Answers1

1

You need to add a <base href="/" /> tag to your HTML.

Ven
  • 19,015
  • 2
  • 41
  • 61