'I only get the url index when doing ionic build
I am having problems disploying the website on a web server.
For that I run the following command
ionic build
Then I copy what is in the build folder to the web server
But it only shows me the url index.html. When in index, I click a button to redirect me to a specific url, like / login, it can’t find the page.
How can I build all urls and not only the index page?
Thanks in advance
PS: I have http Requests in it...
Solution 1:[1]
That is a problem of web server configuration, if you click on a button that should redirect to ex: /about web server searches for about/index.html or about.html, which obviously cannot be found, as build compiles whole app into a single index.html.
You need to edit configuration file of web server and add a rule to redirect any url to index.html, and thus allow ionic itself to manage url access control.
Note: If you want just a web app, i wouldn't use ionic. Your project would have a lot of stuff that is not used. Instead you could just go angular or react or whatever
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | tony |
