# Redirect on startup-\>problem with history

**URL:** <https://forum.ionicframework.com/t/redirect-on-startup-problem-with-history/18599>\
**Category:** ionic-v1\
**Created:** [March 4, 2015, 9:39pm UTC](https://forum.ionicframework.com/t/redirect-on-startup-problem-with-history/18599 "2015-03-04T21:39:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trcharlie](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/trcharlie/32/79518_2.png) [@trcharlie](https://forum.ionicframework.com/u/trcharlie)\
**Post date:** [March 4, 2015, 9:39pm UTC](https://forum.ionicframework.com/t/redirect-on-startup-problem-with-history/18599/1 "2015-03-04T21:39:11Z")

</div>

Hey guys,

I’ve got an app with multiple tabs. In my main tab there are 3 views, call them A,B and C.  
The user navigates exactly in this order with the option to go back only on view B. The user should not have a possibility to leave view C without pressing one single button (which returns him to view B). This is all working perfectly.

But when the user closes the app, he have to get redirected to view C if this is the view he have been on when leaving the app (for e.g. rebooting). I included another view at the startup to check if a certain variable is checked and redirect to view C based on this variable.

Now I’m stuck: i can’t go back from view C to view B because the views A and B are not in the history. If I change the view using $state.go, the history is also not what the user would expect (pressing back on view B bringing him to view A, not, as it is the case, to view C). I hope I described the problem acurate and somebody from you guys have a hint for me on what to try next.

Any help’s appreciated.

cheers, charlie

---

<div class="post-metadata">

**Author:** ![wedgybo](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/wedgybo/32/64033_2.png) [@wedgybo](https://forum.ionicframework.com/u/wedgybo)\
**Post date:** [March 5, 2015, 12:34am UTC](https://forum.ionicframework.com/t/redirect-on-startup-problem-with-history/18599/2 "2015-03-05T00:34:53Z")

</div>

I get the problem you’re trying to solve. I recently put up and article which deals with your problem, although it’s talking about deep linking. The theory behind the solution should solve your problem. Check it out and if it’s still confusing I’ll see if I can help out further.

> **[Deep linking in Ionic Mobile Applications – AngularJS Articles – Medium](https://medium.com/angularjs-articles/deep-linking-in-ionic-mobile-applications-44d8b4685bb3)**
>
> Deep linking inside of cordova apps build with angular has it’s challenges. This article details some clean solutions to these challenges

---

<div class="post-metadata">

**Author:** ![trcharlie](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/trcharlie/32/79518_2.png) [@trcharlie](https://forum.ionicframework.com/u/trcharlie)\
**Post date:** [March 5, 2015, 11:33am UTC](https://forum.ionicframework.com/t/redirect-on-startup-problem-with-history/18599/3 "2015-03-05T11:33:02Z")

</div>

Thank you so much, with some minor modifications it works like a charm.  
One last question though: is there an easy way to map this behavior to the android back-button?
