Hi all,
I’m currently trying to clean my url using IIS rewrite
basicly i want to rewrite using IIS rewrite from http://www.domain.com/list to http://www.domain.com/app/list
but when i try to access http://www.domain.com/list IONIC not recognize it and brought to $urlRouterProvider.otherwise (app/index)
this method are run correctly if i use redirect on IIS rewrite rules
is there something miss or it cannot be happen
below are my app.js:
.config(function($stateProvider, $urlRouterProvider, $locationProvider) {
$stateProvider
.state('app', {
url: "/app",
abstract: true,
templateUrl: "templates/menu.html",
controller: 'AppCtrl'
})
.state('app.index', {
url: "/index",
views: {
'menuContent': {
templateUrl: "templates/home.html",
controller: 'indexController'
}
}
})
.state('app.list', {
url: "/list",
views: {
'menuContent': {
templateUrl: "templates/list.html",
controller: 'indexController'
}
}
})
$urlRouterProvider.otherwise('/app/index');
$locationProvider.hashPrefix('!');
$locationProvider.html5Mode(true);
This one is my web.config:
<rule name="Rewrite Blog" stopProcessing="true">
<match url="^list$" />
<action type="Rewrite" url="app/list" />
</rule>
<rule name="AngularJS" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/app" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>