Skip to main content
8 events
when toggle format what by license comment
May 6, 2019 at 21:53 comment added CodeMed For one thing, the approach desired in the OP and given in your answer isolates all the views in the browser app, so that the server can focus on serving a complete app instead of having the server try to be a UI app in addition to simply being a server. Thank you and +1 for answering the question in the OP.
May 6, 2019 at 21:50 vote accept CodeMed
May 6, 2019 at 21:49 comment added Freddy I said if you want your config "as clean as possible"... What's wrong with a "page not found" if the page is not found? Sorry, I have no idea how your Angular app works.
May 6, 2019 at 21:40 comment added Freddy Your RedirectMatch simply doesn't catch all the paths you want. You could modify it and add lots of exceptions for every file you add somewhere to your DocumentRoot. But I don't think this is a good idea. The solution above rewrites all URI paths to /index.html which are not found in your DocumentRoot. If your app only needs files inside the DocumentRoot and has no other rewriting or proxying, then this could work for you.
May 6, 2019 at 21:40 comment added CodeMed OK. Your approach works. But why do you think that I should allow Apache to return a 404 here? The result of your code is that now the Angular 7 app running in the browser is able to return its own 404 page for every route after mydomain.com that is not defined in the Angular app. This allows separation of concerns, so that the Angular app can manage all the routes not specified on the server. What is wrong with this?
May 6, 2019 at 21:32 comment added CodeMed Please have a look at the edit I just made to the OP.
May 6, 2019 at 21:27 history edited Freddy CC BY-SA 4.0
added 131 characters in body
May 6, 2019 at 21:22 history answered Freddy CC BY-SA 4.0