# No URL for page in Ionic

**URL:** <https://forum.ionicframework.com/t/no-url-for-page-in-ionic/118045>\
**Category:** ionic-v3\
**Created:** [January 12, 2018, 11:32am UTC](https://forum.ionicframework.com/t/no-url-for-page-in-ionic/118045 "2018-01-12T11:32:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spsahu](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@Spsahu](https://forum.ionicframework.com/u/Spsahu)\
**Post date:** [January 12, 2018, 11:32am UTC](https://forum.ionicframework.com/t/no-url-for-page-in-ionic/118045/1 "2018-01-12T11:32:31Z")

</div>

Hi Team,

For every page in **ionic 3** , **URL is not changing**. Each time I am refreshing it get back to my login page and Even I am unable to share link to my particular page.

**Is there any way to get URL as well for each page???**

Thanks

---

<div class="post-metadata">

**Author:** ![flycoders\_sourav](https://avatars.discourse-cdn.com/v4/letter/f/e47c2d/32.png) [@flycoders\_sourav](https://forum.ionicframework.com/u/flycoders_sourav)\
**Post date:** [January 12, 2018, 12:30pm UTC](https://forum.ionicframework.com/t/no-url-for-page-in-ionic/118045/2 "2018-01-12T12:30:35Z")

</div>

Actually want you want to do?

---

<div class="post-metadata">

**Author:** ![Spsahu](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@Spsahu](https://forum.ionicframework.com/u/Spsahu)\
**Post date:** [January 12, 2018, 1:42pm UTC](https://forum.ionicframework.com/t/no-url-for-page-in-ionic/118045/3 "2018-01-12T13:42:30Z")

</div>

Hey  
By using segment  
@IonicPage({  
**segment:“modesto”**  
})  
I am able to get url in browser  
**[http://localhost:8100/#/login](http://localhost:8100/#/login)**

but after login page I am using Side menu page then url become  
[http://localhost:8100/#/sidemenu/mypage](http://localhost:8100/#/sidemenu/mypage)

then when Ia again navigating to login page (on logout)  
url become [http://localhost:8100/#/sidemenu/login](http://localhost:8100/#/sidemenu/login)  
but it is wrong it should be like [http://localhost:8100/#/login](http://localhost:8100/#/login)

Got my problem???

---

<div class="post-metadata">

**Author:** ![flycoders\_sourav](https://avatars.discourse-cdn.com/v4/letter/f/e47c2d/32.png) [@flycoders\_sourav](https://forum.ionicframework.com/u/flycoders_sourav)\
**Post date:** [January 13, 2018, 2:08am UTC](https://forum.ionicframework.com/t/no-url-for-page-in-ionic/118045/4 "2018-01-13T02:08:57Z")

</div>

You can try like this.

```auto
import {IonicApp, Page, NavController, MenuController} from 'ionic/ionic'; 
import {TabsPage} from '../tabs/tabs'; 
import {SignupPage} from '../signup/signup'; 
import {UserData} from '../../providers/user-data';
 @Page({ 
 templateUrl: 'build/pages/login/login.html' 
 }) 
 export class LoginPage { 

 constructor(nav: NavController, userData: UserData, menu: MenuController) { 

 this.nav = nav; 
 this.userData = userData; 
 this.login = {}; 
 this.submitted = false;
  this.menu = menu; 
  } 
  onLogin(form) {
  this.submitted = true; 
  if (form.valid) { 
  	this.userData.login(); this.nav.push(TabsPage); 

  } 
} 
onSignup() { 
	this.nav.push(SignupPage); 
} 
onPageDidEnter() { 
	// the left menu should be disabled on the login page 

	this.menu.enable(false); 
} 
onPageDidLeave() { 
	// enable the left menu when leaving the login page 
this.menu.enable(true); 
} 
}

```

---

<div class="post-metadata">

**Author:** ![Spsahu](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@Spsahu](https://forum.ionicframework.com/u/Spsahu)\
**Post date:** [February 23, 2018, 9:57am UTC](https://forum.ionicframework.com/t/no-url-for-page-in-ionic/118045/5 "2018-02-23T09:57:45Z")

</div>

this is nice but it will not solve the url problem.  
by using **this.appCtrl.getRootNav().setRoot(“LoginPage”)** inside logout function I am able to manage correct url.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:55pm UTC](https://forum.ionicframework.com/t/no-url-for-page-in-ionic/118045/6 "2021-07-19T21:55:44Z")

</div>

Closed on July 19, 2021, 9:55pm UTC


