# Unable to redirect to proper URL

**URL:** <https://community.auth0.com/t/unable-to-redirect-to-proper-url/9477>\
**Category:** Get Help\
**Tags:** html5mode, redirecturi, angularjs\
**Created:** [February 13, 2018, 11:26am UTC](https://community.auth0.com/t/unable-to-redirect-to-proper-url/9477 "2018-02-13T11:26:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aqeelsmith](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@aqeelsmith](https://community.auth0.com/u/aqeelsmith)\
**Post date:** [February 13, 2018, 11:26am UTC](https://community.auth0.com/t/unable-to-redirect-to-proper-url/9477/1 "2018-02-13T11:26:28Z")

</div>

Hi Team , I am using LOCK 11 in my application with html5mode disabled . The redirect url I have specified as [http://192.168.31.160:8000/#/subscribe](http://192.168.31.160:8000/#/subscribe) but whenever I try logging in , it redirects to [http://192.168.31.160:8000/#/home](http://192.168.31.160:8000/#/home) (default web page) .  
Also , I intercepted the url before redirecting , it is [http://192.168.31.160:8000/#access\_token=abc&expires\_in=7200&token\_type=Bearer&state=def&id\_token=ghi](http://192.168.31.160:8000/#access_token=abc&expires_in=7200&token_type=Bearer&state=def&id_token=ghi) .Shouldn’t it be something like [http://192.168.31.160:8000/#/subscribe#access\_token=abc](http://192.168.31.160:8000/#/subscribe#access_token=abc).  
Do let me know what seems to be the issue .  
Adding code for reference :  
`myApp.config('lockProvider', '$locationProvider', '$urlRouterProvider', function(lockProvider, $locationProvider, $urlRouterProvider) { lockProvider.init({ clientID: "abc", leeway: 240, domain: "def.auth0.com", options: { autoclose: true, auth: { responseType: 'token id_token', audience: 'https://' + 'def.auth0.com' + '/userinfo', redirectUrl: window.location.origin + '/#/subscribe' }, languageDictionary: { "title": "def" }, theme: { labeledSubmitButton: false, logo: 'favicon.svg', primaryColor: '#FED039' } } }); $locationProvider.hashPrefix(''); } ]);` and handle authentication as function  
` handleAuthentication() {

// uncomment if you are not using HTML5Mode

lock.interceptHash();

lock.on(‘authenticated’, function(authResult) {

if (authResult && authResult.accessToken && authResult.idToken) {

setSession(authResult);  
} });  
lock.on(‘authorization\_error’, function(err) {  
console.log(err);  
alert( 'Error: ’ + err.error + ‘. Check the console for further details.’ ); }); } `

---

<div class="post-metadata">

**Author:** ![ricardo.batista](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ricardo.batista/32/7711_2.png) [@ricardo.batista](https://community.auth0.com/u/ricardo.batista)\
**Post date:** [February 13, 2018, 4:18pm UTC](https://community.auth0.com/t/unable-to-redirect-to-proper-url/9477/2 "2018-02-13T16:18:38Z")

</div>

Could you share a snippet of code from your authentication request?

---

<div class="post-metadata">

**Author:** ![aqeelsmith](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@aqeelsmith](https://community.auth0.com/u/aqeelsmith)\
**Post date:** [February 14, 2018, 10:31am UTC](https://community.auth0.com/t/unable-to-redirect-to-proper-url/9477/3 "2018-02-14T10:31:06Z")

</div>

Hi @ricardo.batista , updated description with code . Sorry for the messy code , I tried putting it properly thrice , but it seems to fallback to this format.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [August 27, 2019, 10:33am UTC](https://community.auth0.com/t/unable-to-redirect-to-proper-url/9477/4 "2019-08-27T10:33:34Z")

</div>


