AngularJS All slashes in URL changed to %2F

Solution 1:

%2F is the percent-encoding for the forward-slash / character.

This problem is related to the fact that AngularJS 1.6 has changed the default for hash-bang urls in the $location service.

To revert to the previous behavior:

appModule.config(['$locationProvider', function($locationProvider) {
  $locationProvider.hashPrefix('');
}]);

For more information, see SO: angularjs 1.6.0 (latest now) routes not working.

Solution 2:

The most simple solution is to add a ! to client-side URLs (if not using HTML5 mode, which you probably do if you're here).

Client-side, update URLS like this:

#/foo/bar > #!/foo/bar

And since you keep the #, there is no issue of conflict with server-side routing. Everyone happy.