角度: 1.1.5
私はに行きます:
HTML5モードをオフにして正常に動作するhttp://xxxxx.com/route1/route2/route3
代わり/route3
にトリガーされます... :(route1/route2/route3
Nginxの設定
location / {
index index.html;
try_files $uri $uri/ /index.html?$args;
}
私のアプリ構成
$routeProvider.when('/route1/route2/route3', {
templateUrl: '/views/home.html',
controller: 'HomeCtrl'
});
$routeProvider.when('/route3', {
templateUrl: '/views/home.html',
controller: 'HomeCtrl'
});
$locationProvider.hashPrefix('!');
$locationProvider.html5Mode(true);
$location
ログ:
$$protocol: "http", $$host: "xxxxxx"…}
$$absUrl: "http://xxxxxxx.com/route1/route2/route3"
$$hash: ""
$$host: "10.44.11.73"
$$path: "/route3"
$$port: 80
$$protocol: "http"
$$replace: false
$$url: "/route3"
ネストされたルートで HTML5 URL が機能するように設定を変更するにはどうすればよいですか?