0

I am trying to remove the hashtags from my Angularjs app's URLs using the locationProvider, and it works well until I refresh a page manually. When I am refreshing page my angularjs js and css file now loading. Please help me on that.

In index.jsp

App.js

myapp.config(function($routeProvider, USER_ROLES, IdleProvider, KeepaliveProvider, $locationProvider) { $locationProvider.html5Mode(true); }

urlrewrite.xml

/login resources/partials/login.html /login/brandname resources/partials/login.html /home resources/partials/home.html

web.xml:

http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> Archetype Created Web Application UrlRewriteFilter org.tuckey.web.filters.urlrewrite.UrlRewriteFilter confPath /WEB-INF/urlrewrite.xml UrlRewriteFilter /* REQUEST FORWARD

Praveen
  • 39
  • 9

1 Answers1

0

adding base base tag could also help you solve the # problem. And also did you checked this link? https://scotch.io/tutorials/pretty-urls-in-angularjs-removing-the-hashtag

Jannomeister
  • 621
  • 4
  • 23
  • Hi Janno Tabamo , I have checked above link also.I have done same. But when I am refreshing page my css and js file not loading. – Praveen May 29 '18 at 09:05
  • are you using `nginx` in your backend? or its just pure frontend? you might find some help try check this issue https://stackoverflow.com/questions/41460772/angularjs-how-to-remove-bang-prefix-from-url – Jannomeister May 29 '18 at 09:47
  • I am using spring in back-end for rest api and front-end angularjs. I have checked above url also. Please help me out – Praveen May 29 '18 at 10:08
  • Im not really familiar with spring. But I hope this link could help you https://stackoverflow.com/questions/24837715/spring-boot-with-angularjs-html5mode – Jannomeister May 29 '18 at 10:11
  • This is a problem with the routing configuration of your backend. – Jannomeister May 29 '18 at 10:12
  • Any one know what configuration I need to put on back-end side for routing because I am getting 404. – Praveen May 29 '18 at 10:42