# Prevent back route navigation for specific page

**URL:** <https://forum.ionicframework.com/t/prevent-back-route-navigation-for-specific-page/208767>\
**Category:** Ionic Framework\
**Created:** [April 27, 2021, 4:09pm UTC](https://forum.ionicframework.com/t/prevent-back-route-navigation-for-specific-page/208767 "2021-04-27T16:09:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Romwtb](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/romwtb/32/141985_2.png) [@Romwtb](https://forum.ionicframework.com/u/Romwtb)\
**Post date:** [April 27, 2021, 4:09pm UTC](https://forum.ionicframework.com/t/prevent-back-route-navigation-for-specific-page/208767/1 "2021-04-27T16:09:27Z")

</div>

It is possible to prevent back route navigation executed from hardware `backbutton` on specific page ?  
In case, for example, when i would like to initialize additional function before navigate back. So, hardware `backbutton` must be clicked few times for a back route. But only on specific page. All other pages must works normal.

**Ionic with React in use.**

---

<div class="post-metadata">

**Author:** ![Daveshirman](https://avatars.discourse-cdn.com/v4/letter/d/ecd19e/32.png) [@Daveshirman](https://forum.ionicframework.com/u/Daveshirman)\
**Post date:** [April 27, 2021, 4:41pm UTC](https://forum.ionicframework.com/t/prevent-back-route-navigation-for-specific-page/208767/2 "2021-04-27T16:41:56Z")

</div>

If you’re using Angular, you can use an AuthenticationGuard.

Here’s a random article I got from searching:

[https://medium.com/@ryanchenkie\_40935/angular-authentication-using-route-guards-bf7a4ca13ae3](https://medium.com/@ryanchenkie_40935/angular-authentication-using-route-guards-bf7a4ca13ae3)

If you don’t wanna do that, you can just register an override for the back button in your page, do something custom then call navigate back in your code.

The Ionic docs have this all mapped out both for Capacitor and Cordova.

Which method you use to override the back button (if you choose to do so) will depend on what native container you’re using.

> **[Hardware Back Button - Ionic Documentation](https://ionicframework.com/docs/developing/hardware-back-button)**
>
> Ionic is the app platform for web developers. Build amazing mobile, web, and desktop apps all with one shared code base and open web standards

---

<div class="post-metadata">

**Author:** ![Romwtb](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/romwtb/32/141985_2.png) [@Romwtb](https://forum.ionicframework.com/u/Romwtb)\
**Post date:** [April 27, 2021, 4:42pm UTC](https://forum.ionicframework.com/t/prevent-back-route-navigation-for-specific-page/208767/3 "2021-04-27T16:42:58Z")

</div>

Thank you, interesting especially in React case.
