I now have a URL like this: http://172.25.186.1/wxHome/www/#/tabs/index
After setting $locationProvider.html5Mode(true);, in theory the URL should become like this: http://172.25.186.1/wxHome/www/tabs/index
But the actual situation is this: http://172.25.186.1/tabs/index
The routing configuration is as follows:
$stateProvider.
state('kjk', {//框架页
url: "/",
controller: "KJK.rootController",
templateUrl: baseUrl+"views/templates/kjk_Main.html"
}).
state('kjk.tabs', {//tabs框架页
url: "tabs",
controller: "KJK.tabsController",
templateUrl: baseUrl+"views/templates/kjk_Tabs.html"
}).
state('kjk.tabs.index', {//首页
url: "/index",
views: {
'index_tabs': {
controller: "KJK.index.indexController",
templateUrl: baseUrl+"views/kjk_index.html"
}
}
})
HTML
<base href="/" />
How can I add routing information to my http://172.25.186.1/wxHome/www/之后?
Change the content of base to:
That’s it.
You can consider adding a base tag to the page
Is the problem solved?