URL replicating path each time I hit F5

Asked

Viewed 66 times

0

I climbed an angled design to the FTP, the problem is that every time I squeeze F5 he repeats the relative path.

So when the access starts at

www.mysite.com.br/one/auth/login Then F5 grip it goes like this: www.mysite.com.br/one/auth/login/auth/login

And it stays that way every time I update:

www.mysite.com.br/one/auth/login/auth/login/auth/login www.mysite.com.br/one/auth/login/auth/login/auth/login/auth/login....

Now I don’t know if there has to be, but it was after altering the basis href that it happened

<html>

<head>
  <meta charset="utf-8">
  <title>SITE</title>

  <base href="#">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/png" href="favicon.png">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

The direction is appearing in my file login-routing.module.ts

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { LoginComponent } from './login.component';
import { TelaComponent } from './tela/tela.component';

const routes: Routes = [{
  path: '',
  component: LoginComponent,
  children: [
    {
      path: 'login',
      component: TelaComponent,
    },

    {
      path: '',
      redirectTo: 'login',
      pathMatch: 'full',
    },
    { path: '**', redirectTo: 'login' },
  ],
},
{ path: '**', redirectTo: 'auth/login' }];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class LoginRoutingModule {
}

  • Without code it will be difficult to help. Help us help you, put your code there.

  • So I don’t know if it’s specifically part of the code or if it’s the way I run the build at the angle, I’m running: ng build --base-href www.mysite.com.br/one/ -deploy-url www.mysite.com.br/one/

  • Put the code that redirects to auth/login, it is likely that the fault is there.

  • I added the routing that has the redirect

  • The problem is in the context you made the deploy, make the test run --base-href . and comment here what gave

  • I put the . on --base-href and it’s still doubling

Show 1 more comment

1 answer

0

Changes the auth/loginfor /auth/login, and the login for /login.

  • Didn’t work for me

  • Try to change the other values too, always putting a bar first. And if there are other parts of the code that redirect it is ideal to put a bar first. How does the bar work? it makes the redirect start from the domain URL, without the bar the redirect will concatenate with the current address

Browser other questions tagged

You are not signed in. Login or sign up in order to post.