I want to redirect at Home page if user type any URL which is not exist in system
How to redirect at Home page if any router does not exist in Jhipster Angular 4 App?
1k views Asked by Ketan Navadiya At
2
There are 2 answers
5
Jon Ruddell
On
In app.module.ts, add the following line to the imports list, after the other modules. If it's added before other routes, it will redirect to home for those routes.
RouterModule.forChild([{ path: '**', redirectTo: '/' }])
You'll also need to import RouterModule:
import { RouterModule } from '@angular/router';
Related Questions in ANGULAR
- Firebase link existing user to anonymous account?
- It doesnt always show all the books on my homepage
- Google adsense ads.txt status cannot be not found
- When I navigate to the URL'http://localhost:4200/', it redirects me back
- Ionic Angular Standalone ion-icon are not showing at all
- How to make Angular understand that view child is of a specific type, not a general ElementRef?
- vscode, debug angular, first time, doesn't debug, 2nd time stops at main.js then it's ok
- How to perform CRUD operations on a static JSON array in Angular? (without API)
- Ngrx props<>() method in createAction()
- How to animate rotation of an image inside input control?
- Detecting click inside and outside of the listening component in Angular
- Angular - type guard not narrowing types
- In node_modules file i am getting Angular genric error while using fontawesome in angular12
- Angular 16 sending null values to API
- GoogleCloud Error: Not Found The requested URL was not found on this server
Related Questions in ANGULAR-UI-ROUTER
- When I navigate to the URL'http://localhost:4200/', it redirects me back
- Angular title routing translation
- Angular ngOnInit doesnt get triggered when i refresh the page
- Nested routes with param and router refresh process
- Bundle size after migrating to all standalone and implementing lazy loading
- Named Router Outlet- I need to active the both multiple outlets Using angularv17.0^.0^(main outlet + 2 named Outlets)
- Implement routing with steps component in a dynamic dialog priemng
- Preload all components when lazy loading standalone components for routing
- Angular constant errors
- How do I filter out a value returned from a GET method?
- Angular material design <mat-step> data not showing
- Angular upgrade from 9 to 10 return errors
- The problem of navbar and side bar and routing
- How do I add Swiper.js to an Angular project without bugs
- CanActivateFn get hit but same appcomponent get hit too. standalone. angular
Related Questions in ANGULAR2-ROUTING
- ASP.Net Core Web API URLs call gets rerouted to Angular project
- Platform-based redirect in Angular 16
- How can i solve routing issue that works on simulator but not on device for my react native driver app?
- routerLink doesn't navigate to lazy loading modules for a named router outlet
- routerLink doesn't navigate to lazy loading modules
- Is there a way to send static routing data with a parameterized path?
- Router in global navigation always give me / even using relative path
- routerlink always returns to ' '
- Restore form data after re-routing
- How to separate desktop and mobile page and lazy load each page in Angular?
- Can't make Router Outlet not working in Angular 17
- Change the param name & ID with the next previous buttons
- Angular 2 Not redirecting to Dashboard
- How do I use a CanActivateFn to hide a link?
- Is there a way to change angular routing component depending on the value of a routing parameter
Related Questions in JHIPSTER
- Jhipster displaying mismatch data
- How To Rename An Enity?
- Blueprint migration problems to JHipster 8
- Jhipster monolith with Vue and Keycloak - Spring session timeout does not logout web ui
- Account creation errors with Jhipster after altering user service class
- JHipster Application Defaults to LTR Instead of RTL for Arabic Language
- How do I merge the user account entity and account provided by jhipster?
- Angular PrimeNg p-calendar in a JHipster project
- Problem with running angular test with jhipster
- How to secure jhipster-registry and how to aggregate api-docs inside of jhipster apigateway when profile prod is active
- How to authenticate requests by COOKIE in JHipster v8.1.0
- JHipster blueprint context
- How to interact with JHipster context in blueprints
- Refactor multiple ifs in create specification
- JHipster 8.1.0 with Oracle fails IT
Related Questions in JHIPSTER-REGISTRY
- Unable to upgrade Jhipster from v6.6.0 to latest stable version 7.9.3 or beta version 8.0.0-beta.2
- Spring cloud config OAuth2.0 protected server client authentication
- Can I generate the application according to a package structure that I have determined in Jhipster?
- I have an error while creating Jhipster Microservice app
- Gateway not appearing in the jhipster registry
- How to specify a field name in an entity in jhipster
- Services registered in Jhipster registry, but gateway cannot route requests
- jHipster microservice Swagger-UI not available in registry / control center API tab
- JHipster and Node.js
- How to customize GUI in Jhipster+ React application
- jhipster microservices client springcloud config with authorization header to jhipster registry
- JHipster Registry - Problems deploying to ECS
- manifest for *** not found: manifest unknown: manifest unknown
- How do I start jhipster microservices locally in dev mode?
- Jhipster registry not working on localhost
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
You can use
**rule at the end of yournavbar.routesto redirect to Home page. Below is the example: