I ´m using AngularJS and Apache. For routing I ´m using ui router module.
I have a site http://example.com I have a rule in .htaccess => DirectoryIndex index.html
So when user goes to http://example.com it renders index.html but not shows it on url
On Index.html there is a button wich you click and send you to userwelcome page
This is the url => http://example.com/userwelcome.html#/welcome
The userwelcome page has 3 states. Login, Signup and Welcome
The code from userwelcome.js
.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/welcome');
$stateProvider
.state('login', {
url: '/login',
templateUrl: 'login/vw_login.html',
})
.state('welcome', {
url: '/welcome',
templateUrl: 'userWelcome/vw_welcome.html',
})
.state('signup', {
url: '/signup',
templateUrl: 'signup/vw_signup.html'
});
}]);
When the user logins, the site redirects to home.html page and the url is => http://example.com/home.html#/home
What I want is that urls like the following:
for userWelcome.html welcome state http://example.com/welcome
for userWelcome.html login state http://example.com/login
for home.html home state http://example.com/home
With this structure is posible? or I have to have all states (login, signup, home, userwelcome) in one single page ?
With ngroute I read that you can use html5mode with $location. In my case I m using ui router, so can I mix both of them?
In Apache I have to create more rules for rewrite?
I find a lot of post, articles talking about pretty urls but each one has differents solutions and I cant make it work.