# 404 after login using HashLocation (# with en-US or fr) in prod

**URL:** <https://devforum.okta.com/t/404-after-login-using-hashlocation-with-en-us-or-fr-in-prod/30587>\
**Category:** Questions\
**Tags:** angular, authjs\
**Created:** [September 16, 2024, 3:38pm UTC](https://devforum.okta.com/t/404-after-login-using-hashlocation-with-en-us-or-fr-in-prod/30587 "2024-09-16T15:38:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sabrinaBinaa89](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@sabrinaBinaa89](https://devforum.okta.com/u/sabrinaBinaa89)\
**Post date:** [September 16, 2024, 3:38pm UTC](https://devforum.okta.com/t/404-after-login-using-hashlocation-with-en-us-or-fr-in-prod/30587/1 "2024-09-16T15:38:01Z")

</div>

Hi, I need your help, please 😭  
Actually, my project is running correctly in local (dev) but in prod I have 404 not found after login:  
My objective is to redirect after login to [https://domain.com/en-US/#/](https://domain.com/en-US/#/), I defined on the okta site, and in my code redirect uri = [https://domain.com/login/callback](https://domain.com/login/callback)  
and I use:

```auto
   this.router.events.pipe(
  
    filter((e: Event | RouterEvent): e is RouterEvent => e instanceof RouterEvent && e instanceof NavigationStart) ,
       filter(() => this.oktaAuth.isLoginRedirect()),
       switchMap(() => defer(() => this.oktaAuth.handleLoginRedirect())),
      takeUntil(this.destroySub$)
    ).subscribe(() => {
 
  ....
    });

```

and I try to add

```auto
 this.router.navigate(['/'], { fragment: 'login/callback' }); 

```

to subscribe (but some problem)

```auto
 { path: 'login/callback', component: OktaCallbackComponent}
....
],
           { scrollPositionRestoration: 'enabled', anchorScrolling: 'enabled', onSameUrlNavigation: 'reload' ,useHash: true})

```

Noted that I use :  
“@okta/okta-angular”: “^6.4.0”,  
“@okta/okta-auth-js”: “^7.8.0”,  
angular 17  
node 18.13.0  
typseScript 5.2.2

someone can help me please to solve this problem

---

<div class="post-metadata">

**Author:** ![alisaduncan](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/alisaduncan/32/3429_2.png) [@alisaduncan](https://devforum.okta.com/u/alisaduncan)\
**Post date:** [September 19, 2024, 3:28pm UTC](https://devforum.okta.com/t/404-after-login-using-hashlocation-with-en-us-or-fr-in-prod/30587/2 "2024-09-19T15:28:51Z")

</div>

Hi there @sabrinaBinaa89 ,

If your app works locally, but not on prod, I wonder if there’s a prod web server configuration change required. You may want to start with these resources from Angular:

**Ensure web server configuration for SPA**

> **[Angular](https://angular.dev/tools/cli/deployment/)**
>
> The web development framework for building modern apps.

(it looks like the new angular.dev resource doesn’t include examples so I’ll link to the older docs that do have specific config examples)

> **[Angular](https://v17.angular.io/guide/deployment#fallback-configuration-examples)**
>
> The web development framework for building modern apps.

**Support multiple languages in your deployment**

> **[Angular](https://angular.dev/guide/i18n/deploy/)**
>
> The web development framework for building modern apps.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![sabrinaBinaa89](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@sabrinaBinaa89](https://devforum.okta.com/u/sabrinaBinaa89)\
**Post date:** [September 20, 2024, 8:34am UTC](https://devforum.okta.com/t/404-after-login-using-hashlocation-with-en-us-or-fr-in-prod/30587/3 "2024-09-20T08:34:02Z")

</div>

Thank you for your response. I updated the Nginx configuration, and it worked. 😃

 ![image](https://global.discourse-cdn.com/oktadev/original/2X/7/75dd4c815019a6f0e6741a8ee745371352e5bbb4.png)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [September 21, 2024, 8:34am UTC](https://devforum.okta.com/t/404-after-login-using-hashlocation-with-en-us-or-fr-in-prod/30587/4 "2024-09-21T08:34:48Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
