Angular Routing not working on URL Address bar
I have made an Angular project with routing components. And I have handled some URL handling like if a user hits on the URL manually: if the URL exist, it goes to the URL components as defined in the app-routing-module.ts and if the URL doesn't exist, it shows an error page as defined in the code PagenotFoundComponent.
e.g.
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {HomeComponent} from './component/home.component';
import {AboutusComponent} from './component/aboutus.component';
import {SupportComponent} from './component/support.component';
import {PurchaseComponent} from './component/purchase.component';
import {PagenotfoundComponent} from './component/pagenotfound.component';
import {HowitworksComponent} from './component/howitworks.component';
import {ProductComponent} from './component/product.component';
import { ProductVarientDetailsComponent } from './component/product-varient-details.component';
const routes: Routes = [
{ path: '', redirectTo: '/home', pathMatch: 'full'},
{ path: 'home', component: HomeComponent},
{ path: 'about-us', component: AboutusComponent},
{ path: 'how-it-works', component: HowitworksComponent},
{ path: 'support', component: SupportComponent},
{ path: 'purchase', component: PurchaseComponent},
{ path: 'product/:name/details', component: ProductComponent},
{ path: 'product-variants', component: ProductVarientDetailsComponent},
{ path: '**', component: PagenotfoundComponent}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
export const routingComponents = [HomeComponent, AboutusComponent, SupportComponent,
PurchaseComponent, PagenotfoundComponent, HowitworksComponent,
ProductComponent, ProductVarientDetailsComponent];
So when I manually hit localhost:4200/home, it shows me HomeComponent Page and if I do this localhost:4200/sdnbgbdfgbh, it shows me PagenotfoundComponent Page on the local server.
And then I went to this link: https://angular.io/guide/deployment to deploy my angular application. I follow the steps as the doc. says.
My application is now working completely but when I do some manual url typing it shows me Apache Server Page Not Found. Just this thing is not working in the Angular App.
I have deployed my App on AWS EC2 on Apache Server at PORT 80.
amazon-ec2 deployment angular6 angular-routing
add a comment |
I have made an Angular project with routing components. And I have handled some URL handling like if a user hits on the URL manually: if the URL exist, it goes to the URL components as defined in the app-routing-module.ts and if the URL doesn't exist, it shows an error page as defined in the code PagenotFoundComponent.
e.g.
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {HomeComponent} from './component/home.component';
import {AboutusComponent} from './component/aboutus.component';
import {SupportComponent} from './component/support.component';
import {PurchaseComponent} from './component/purchase.component';
import {PagenotfoundComponent} from './component/pagenotfound.component';
import {HowitworksComponent} from './component/howitworks.component';
import {ProductComponent} from './component/product.component';
import { ProductVarientDetailsComponent } from './component/product-varient-details.component';
const routes: Routes = [
{ path: '', redirectTo: '/home', pathMatch: 'full'},
{ path: 'home', component: HomeComponent},
{ path: 'about-us', component: AboutusComponent},
{ path: 'how-it-works', component: HowitworksComponent},
{ path: 'support', component: SupportComponent},
{ path: 'purchase', component: PurchaseComponent},
{ path: 'product/:name/details', component: ProductComponent},
{ path: 'product-variants', component: ProductVarientDetailsComponent},
{ path: '**', component: PagenotfoundComponent}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
export const routingComponents = [HomeComponent, AboutusComponent, SupportComponent,
PurchaseComponent, PagenotfoundComponent, HowitworksComponent,
ProductComponent, ProductVarientDetailsComponent];
So when I manually hit localhost:4200/home, it shows me HomeComponent Page and if I do this localhost:4200/sdnbgbdfgbh, it shows me PagenotfoundComponent Page on the local server.
And then I went to this link: https://angular.io/guide/deployment to deploy my angular application. I follow the steps as the doc. says.
My application is now working completely but when I do some manual url typing it shows me Apache Server Page Not Found. Just this thing is not working in the Angular App.
I have deployed my App on AWS EC2 on Apache Server at PORT 80.
amazon-ec2 deployment angular6 angular-routing
Can you update your question with the .htaccess content? to understand clearly need to see the .htaccess configurations.
– Fahim Uddin
Dec 26 '18 at 15:31
My .htaccess file is empty
– Mohit
Dec 27 '18 at 6:06
I have addedRewriteEngine on RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^(.*) /index.html [NC,L]
in the .htaccess file but it is still not working.
– Mohit
Dec 27 '18 at 7:56
add a comment |
I have made an Angular project with routing components. And I have handled some URL handling like if a user hits on the URL manually: if the URL exist, it goes to the URL components as defined in the app-routing-module.ts and if the URL doesn't exist, it shows an error page as defined in the code PagenotFoundComponent.
e.g.
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {HomeComponent} from './component/home.component';
import {AboutusComponent} from './component/aboutus.component';
import {SupportComponent} from './component/support.component';
import {PurchaseComponent} from './component/purchase.component';
import {PagenotfoundComponent} from './component/pagenotfound.component';
import {HowitworksComponent} from './component/howitworks.component';
import {ProductComponent} from './component/product.component';
import { ProductVarientDetailsComponent } from './component/product-varient-details.component';
const routes: Routes = [
{ path: '', redirectTo: '/home', pathMatch: 'full'},
{ path: 'home', component: HomeComponent},
{ path: 'about-us', component: AboutusComponent},
{ path: 'how-it-works', component: HowitworksComponent},
{ path: 'support', component: SupportComponent},
{ path: 'purchase', component: PurchaseComponent},
{ path: 'product/:name/details', component: ProductComponent},
{ path: 'product-variants', component: ProductVarientDetailsComponent},
{ path: '**', component: PagenotfoundComponent}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
export const routingComponents = [HomeComponent, AboutusComponent, SupportComponent,
PurchaseComponent, PagenotfoundComponent, HowitworksComponent,
ProductComponent, ProductVarientDetailsComponent];
So when I manually hit localhost:4200/home, it shows me HomeComponent Page and if I do this localhost:4200/sdnbgbdfgbh, it shows me PagenotfoundComponent Page on the local server.
And then I went to this link: https://angular.io/guide/deployment to deploy my angular application. I follow the steps as the doc. says.
My application is now working completely but when I do some manual url typing it shows me Apache Server Page Not Found. Just this thing is not working in the Angular App.
I have deployed my App on AWS EC2 on Apache Server at PORT 80.
amazon-ec2 deployment angular6 angular-routing
I have made an Angular project with routing components. And I have handled some URL handling like if a user hits on the URL manually: if the URL exist, it goes to the URL components as defined in the app-routing-module.ts and if the URL doesn't exist, it shows an error page as defined in the code PagenotFoundComponent.
e.g.
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {HomeComponent} from './component/home.component';
import {AboutusComponent} from './component/aboutus.component';
import {SupportComponent} from './component/support.component';
import {PurchaseComponent} from './component/purchase.component';
import {PagenotfoundComponent} from './component/pagenotfound.component';
import {HowitworksComponent} from './component/howitworks.component';
import {ProductComponent} from './component/product.component';
import { ProductVarientDetailsComponent } from './component/product-varient-details.component';
const routes: Routes = [
{ path: '', redirectTo: '/home', pathMatch: 'full'},
{ path: 'home', component: HomeComponent},
{ path: 'about-us', component: AboutusComponent},
{ path: 'how-it-works', component: HowitworksComponent},
{ path: 'support', component: SupportComponent},
{ path: 'purchase', component: PurchaseComponent},
{ path: 'product/:name/details', component: ProductComponent},
{ path: 'product-variants', component: ProductVarientDetailsComponent},
{ path: '**', component: PagenotfoundComponent}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
export const routingComponents = [HomeComponent, AboutusComponent, SupportComponent,
PurchaseComponent, PagenotfoundComponent, HowitworksComponent,
ProductComponent, ProductVarientDetailsComponent];
So when I manually hit localhost:4200/home, it shows me HomeComponent Page and if I do this localhost:4200/sdnbgbdfgbh, it shows me PagenotfoundComponent Page on the local server.
And then I went to this link: https://angular.io/guide/deployment to deploy my angular application. I follow the steps as the doc. says.
My application is now working completely but when I do some manual url typing it shows me Apache Server Page Not Found. Just this thing is not working in the Angular App.
I have deployed my App on AWS EC2 on Apache Server at PORT 80.
amazon-ec2 deployment angular6 angular-routing
amazon-ec2 deployment angular6 angular-routing
asked Dec 26 '18 at 13:31
MohitMohit
62
62
Can you update your question with the .htaccess content? to understand clearly need to see the .htaccess configurations.
– Fahim Uddin
Dec 26 '18 at 15:31
My .htaccess file is empty
– Mohit
Dec 27 '18 at 6:06
I have addedRewriteEngine on RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^(.*) /index.html [NC,L]
in the .htaccess file but it is still not working.
– Mohit
Dec 27 '18 at 7:56
add a comment |
Can you update your question with the .htaccess content? to understand clearly need to see the .htaccess configurations.
– Fahim Uddin
Dec 26 '18 at 15:31
My .htaccess file is empty
– Mohit
Dec 27 '18 at 6:06
I have addedRewriteEngine on RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^(.*) /index.html [NC,L]
in the .htaccess file but it is still not working.
– Mohit
Dec 27 '18 at 7:56
Can you update your question with the .htaccess content? to understand clearly need to see the .htaccess configurations.
– Fahim Uddin
Dec 26 '18 at 15:31
Can you update your question with the .htaccess content? to understand clearly need to see the .htaccess configurations.
– Fahim Uddin
Dec 26 '18 at 15:31
My .htaccess file is empty
– Mohit
Dec 27 '18 at 6:06
My .htaccess file is empty
– Mohit
Dec 27 '18 at 6:06
I have added
RewriteEngine on RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^(.*) /index.html [NC,L]
in the .htaccess file but it is still not working.– Mohit
Dec 27 '18 at 7:56
I have added
RewriteEngine on RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^(.*) /index.html [NC,L]
in the .htaccess file but it is still not working.– Mohit
Dec 27 '18 at 7:56
add a comment |
1 Answer
1
active
oldest
votes
Try redirecting to path 404
like this :
const routes: Routes = [
...otherRoutes
{ path: '404', component: PagenotfoundComponent},
{ path: '**', redirectTo: '404'}
];
If not working try to configure .htaccess according to Angular Documentation :
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html
Remember all path hits should go through index.html
in apache config.
Or try this piece of documentation, I hope it helps :
https://github.com/mgechev/angular-seed/wiki/Deploying-prod-build-to-Apache-2
I did to edit app-routing.module.ts file as your recommendation and update the .htacces file as well. I added web.config file at the "/var/www/html/" folder as Angular doc is documented. I wanted to try Nginx: use try_files, as described in Front Controller Pattern Web Apps, modified to serve index.html: Actually I don't know where I have to do this. And the App is still not working for deliberately URL hitting or refreshing the page.
– Mohit
Dec 28 '18 at 7:36
@Mohit , don't mixup nginx and apache to serve a single angular application. can you follow this piece of documentation ?https://github.com/mgechev/angular-seed/wiki/Deploying-prod-build-to-Apache-2
– Fahim Uddin
Dec 28 '18 at 7:44
Thank you so much. This document works for me. I was badly stuck in this. Thank you again!
– Mohit
Dec 28 '18 at 10:23
I am updating the answer, If I helped you please mark this answer as solved. Thanks.
– Fahim Uddin
Dec 28 '18 at 14:22
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53932794%2fangular-routing-not-working-on-url-address-bar%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try redirecting to path 404
like this :
const routes: Routes = [
...otherRoutes
{ path: '404', component: PagenotfoundComponent},
{ path: '**', redirectTo: '404'}
];
If not working try to configure .htaccess according to Angular Documentation :
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html
Remember all path hits should go through index.html
in apache config.
Or try this piece of documentation, I hope it helps :
https://github.com/mgechev/angular-seed/wiki/Deploying-prod-build-to-Apache-2
I did to edit app-routing.module.ts file as your recommendation and update the .htacces file as well. I added web.config file at the "/var/www/html/" folder as Angular doc is documented. I wanted to try Nginx: use try_files, as described in Front Controller Pattern Web Apps, modified to serve index.html: Actually I don't know where I have to do this. And the App is still not working for deliberately URL hitting or refreshing the page.
– Mohit
Dec 28 '18 at 7:36
@Mohit , don't mixup nginx and apache to serve a single angular application. can you follow this piece of documentation ?https://github.com/mgechev/angular-seed/wiki/Deploying-prod-build-to-Apache-2
– Fahim Uddin
Dec 28 '18 at 7:44
Thank you so much. This document works for me. I was badly stuck in this. Thank you again!
– Mohit
Dec 28 '18 at 10:23
I am updating the answer, If I helped you please mark this answer as solved. Thanks.
– Fahim Uddin
Dec 28 '18 at 14:22
add a comment |
Try redirecting to path 404
like this :
const routes: Routes = [
...otherRoutes
{ path: '404', component: PagenotfoundComponent},
{ path: '**', redirectTo: '404'}
];
If not working try to configure .htaccess according to Angular Documentation :
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html
Remember all path hits should go through index.html
in apache config.
Or try this piece of documentation, I hope it helps :
https://github.com/mgechev/angular-seed/wiki/Deploying-prod-build-to-Apache-2
I did to edit app-routing.module.ts file as your recommendation and update the .htacces file as well. I added web.config file at the "/var/www/html/" folder as Angular doc is documented. I wanted to try Nginx: use try_files, as described in Front Controller Pattern Web Apps, modified to serve index.html: Actually I don't know where I have to do this. And the App is still not working for deliberately URL hitting or refreshing the page.
– Mohit
Dec 28 '18 at 7:36
@Mohit , don't mixup nginx and apache to serve a single angular application. can you follow this piece of documentation ?https://github.com/mgechev/angular-seed/wiki/Deploying-prod-build-to-Apache-2
– Fahim Uddin
Dec 28 '18 at 7:44
Thank you so much. This document works for me. I was badly stuck in this. Thank you again!
– Mohit
Dec 28 '18 at 10:23
I am updating the answer, If I helped you please mark this answer as solved. Thanks.
– Fahim Uddin
Dec 28 '18 at 14:22
add a comment |
Try redirecting to path 404
like this :
const routes: Routes = [
...otherRoutes
{ path: '404', component: PagenotfoundComponent},
{ path: '**', redirectTo: '404'}
];
If not working try to configure .htaccess according to Angular Documentation :
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html
Remember all path hits should go through index.html
in apache config.
Or try this piece of documentation, I hope it helps :
https://github.com/mgechev/angular-seed/wiki/Deploying-prod-build-to-Apache-2
Try redirecting to path 404
like this :
const routes: Routes = [
...otherRoutes
{ path: '404', component: PagenotfoundComponent},
{ path: '**', redirectTo: '404'}
];
If not working try to configure .htaccess according to Angular Documentation :
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html
Remember all path hits should go through index.html
in apache config.
Or try this piece of documentation, I hope it helps :
https://github.com/mgechev/angular-seed/wiki/Deploying-prod-build-to-Apache-2
edited Dec 28 '18 at 14:23
answered Dec 27 '18 at 16:11
Fahim UddinFahim Uddin
1831214
1831214
I did to edit app-routing.module.ts file as your recommendation and update the .htacces file as well. I added web.config file at the "/var/www/html/" folder as Angular doc is documented. I wanted to try Nginx: use try_files, as described in Front Controller Pattern Web Apps, modified to serve index.html: Actually I don't know where I have to do this. And the App is still not working for deliberately URL hitting or refreshing the page.
– Mohit
Dec 28 '18 at 7:36
@Mohit , don't mixup nginx and apache to serve a single angular application. can you follow this piece of documentation ?https://github.com/mgechev/angular-seed/wiki/Deploying-prod-build-to-Apache-2
– Fahim Uddin
Dec 28 '18 at 7:44
Thank you so much. This document works for me. I was badly stuck in this. Thank you again!
– Mohit
Dec 28 '18 at 10:23
I am updating the answer, If I helped you please mark this answer as solved. Thanks.
– Fahim Uddin
Dec 28 '18 at 14:22
add a comment |
I did to edit app-routing.module.ts file as your recommendation and update the .htacces file as well. I added web.config file at the "/var/www/html/" folder as Angular doc is documented. I wanted to try Nginx: use try_files, as described in Front Controller Pattern Web Apps, modified to serve index.html: Actually I don't know where I have to do this. And the App is still not working for deliberately URL hitting or refreshing the page.
– Mohit
Dec 28 '18 at 7:36
@Mohit , don't mixup nginx and apache to serve a single angular application. can you follow this piece of documentation ?https://github.com/mgechev/angular-seed/wiki/Deploying-prod-build-to-Apache-2
– Fahim Uddin
Dec 28 '18 at 7:44
Thank you so much. This document works for me. I was badly stuck in this. Thank you again!
– Mohit
Dec 28 '18 at 10:23
I am updating the answer, If I helped you please mark this answer as solved. Thanks.
– Fahim Uddin
Dec 28 '18 at 14:22
I did to edit app-routing.module.ts file as your recommendation and update the .htacces file as well. I added web.config file at the "/var/www/html/" folder as Angular doc is documented. I wanted to try Nginx: use try_files, as described in Front Controller Pattern Web Apps, modified to serve index.html: Actually I don't know where I have to do this. And the App is still not working for deliberately URL hitting or refreshing the page.
– Mohit
Dec 28 '18 at 7:36
I did to edit app-routing.module.ts file as your recommendation and update the .htacces file as well. I added web.config file at the "/var/www/html/" folder as Angular doc is documented. I wanted to try Nginx: use try_files, as described in Front Controller Pattern Web Apps, modified to serve index.html: Actually I don't know where I have to do this. And the App is still not working for deliberately URL hitting or refreshing the page.
– Mohit
Dec 28 '18 at 7:36
@Mohit , don't mixup nginx and apache to serve a single angular application. can you follow this piece of documentation ?
https://github.com/mgechev/angular-seed/wiki/Deploying-prod-build-to-Apache-2
– Fahim Uddin
Dec 28 '18 at 7:44
@Mohit , don't mixup nginx and apache to serve a single angular application. can you follow this piece of documentation ?
https://github.com/mgechev/angular-seed/wiki/Deploying-prod-build-to-Apache-2
– Fahim Uddin
Dec 28 '18 at 7:44
Thank you so much. This document works for me. I was badly stuck in this. Thank you again!
– Mohit
Dec 28 '18 at 10:23
Thank you so much. This document works for me. I was badly stuck in this. Thank you again!
– Mohit
Dec 28 '18 at 10:23
I am updating the answer, If I helped you please mark this answer as solved. Thanks.
– Fahim Uddin
Dec 28 '18 at 14:22
I am updating the answer, If I helped you please mark this answer as solved. Thanks.
– Fahim Uddin
Dec 28 '18 at 14:22
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53932794%2fangular-routing-not-working-on-url-address-bar%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you update your question with the .htaccess content? to understand clearly need to see the .htaccess configurations.
– Fahim Uddin
Dec 26 '18 at 15:31
My .htaccess file is empty
– Mohit
Dec 27 '18 at 6:06
I have added
RewriteEngine on RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^(.*) /index.html [NC,L]
in the .htaccess file but it is still not working.– Mohit
Dec 27 '18 at 7:56