@@ -330,22 +330,37 @@ reload to the original link.
330330### Relative links
331331
332332Be sure to check all relative links, images, scripts etc. Angular requires you to specify the url
333- base in the head of your main html file (`<base href="/my-base">`) unless `html5Mode.requireBase` is
334- set to `false` in the html5Mode definition object passed to `$locationProvider.html5Mode()`. With
333+ base in the head of your main html file (`<base href="/my-base/index.html ">`) unless `html5Mode.requireBase`
334+ is set to `false` in the html5Mode definition object passed to `$locationProvider.html5Mode()`. With
335335that, relative urls will always be resolved to this base url, even if the initial url of the
336336document was different.
337337
338338There is one exception: Links that only contain a hash fragment (e.g. `<a href="#target">`)
339339will only change `$location.hash()` and not modify the url otherwise. This is useful for scrolling
340340to anchors on the same page without needing to know on which page the user currently is.
341341
342+
342343### Server side
343344
344345Using this mode requires URL rewriting on server side, basically you have to rewrite all your links
345346to entry point of your application (e.g. index.html). Requiring a `<base>` tag is also important for
346347this case, as it allows Angular to differentiate between the part of the url that is the application
347348base and the path that should be handled by the application.
348349
350+ ### Base href constraints
351+
352+ The `$location` service is not able to function properly if the current URL is outside the URL given
353+ as the base href. This can have subtle confusing consequencies...
354+
355+ Consider a base href set as follows: `<base href="/base/">` (i.e. the application exists in the "folder"
356+ called `/base`). The URL `/base` is actually outside the application (it refers to the `base` file found
357+ in the root `/` folder).
358+
359+ If you wish to be able to navigate to the application via a URL such as `/base` then you should ensure that
360+ you server is setup to redirect such requests to `/base/`.
361+
362+ See https://github.com/angular/angular.js/issues/14018 for more information.
363+
349364### Sending links among different browsers
350365
351366Because of rewriting capability in HTML5 mode, your users will be able to open regular url links in
0 commit comments