404 error on refreshing page. "unsing ngRoute"

120 views
Skip to first unread message

anubhav.c...@sprytechies.com

unread,
Dec 9, 2015, 4:11:22 AM12/9/15
to AngularJS
i am a newbie to angularJs. i have started learning it now. i am using ngRoute to route the templates. but whenever i refresh the page, i get an 404 error. Can anyone provide the solution for this???

Sander Elias

unread,
Dec 9, 2015, 11:40:56 AM12/9/15
to AngularJS
Hi,

You probably  enabled HTML5 mode, without your server supporting that. (easiest way, make sure the server returns your index.html on any 404). Or turn of html5 mode.

Regards
Sander

anubhav.c...@sprytechies.com

unread,
Dec 10, 2015, 4:47:10 AM12/10/15
to AngularJS

Yes Sander Elias, i have enabled the html5Mode, as want to use the angular without #, is there any way by which i can remove the "#" without getting 404 error.

Sander Elias

unread,
Dec 10, 2015, 8:28:34 AM12/10/15
to AngularJS
Hi,

Sure, make sure your server is compliant to html5 mode. You can do this by configuring your server so, it's returns your index.html instead of your 404 page. There is nothing angular can do for your here, as this is a pure server side issue.

Regards
Sander

anubhav.c...@sprytechies.com

unread,
Dec 10, 2015, 11:08:20 PM12/10/15
to AngularJS

I am using apache, and didn't know how to reconfigure it for the purpose. Can you help me in reconfiguring it...

Sander Elias

unread,
Dec 14, 2015, 12:40:16 AM12/14/15
to AngularJS
Hi,


Regards
Sander
Reply all
Reply to author
Forward
0 new messages