0

I deployed my compiled Angular project as part of an existing project in JBOSS instance and am facing an issue in Browser Refresh

So for example I am calling a short url which looks like

http://x.x.x.x:x/contextPath/projectName

which redirects to

http://x.x.x.x:x/contextPath/scm/projectName/index.html

(baseHref has been set to /contextPath/scm/projectName/)

Now on load URL changes to

.../contextPath/scm/projectName/login

Loading is fine but then on refresh I get 404 as jboss does not recognise the new url

I thought using HashLocation Routing would solve it, but it avails same result.

Any suggestions how to handle this would be helpful.

MediocreDev
  • 93
  • 1
  • 1
  • 6
  • Problem is at your server. You need to set server to serve index.html file when navigating to /contextPath/scm/projectName/[anything]. I think this is a duplicate of https://stackoverflow.com/questions/22739455/htaccess-redirect-for-angular-routes – tomek550 Jan 29 '19 at 13:48
  • Possible duplicate of [htaccess redirect for Angular routes](https://stackoverflow.com/questions/22739455/htaccess-redirect-for-angular-routes) – PierreD Jan 29 '19 at 13:55
  • I did do the server setup, we have an existing project running and we need this to run as part of it. In the web.xml, URL Pattern has been mapped, which is basically a short URL and its redirecting to the index.html, all that is fine but on refresh it changes the url as i mentioned before. Maybe am missing something – MediocreDev Jan 31 '19 at 07:49

0 Answers0