Iam testing my Angular website and have the problem that I cant reach sublinks.
e.g.
https://testing.my-site.de
-works.
-Click on a link to “/main” works too and leads me there.
But calling directly:
https://testing.my-site.de/main
gives me a 404.
Is it a Webserver/https settings I miss?
Thanks in advance for any hint.
Gregor
2
Answers
If you’re hosting Angular inside Web API for example you’ll need to do something like this in your Startup.cs to change request to index.html when using routing.
Same principle would apply elsewhere I guess.
In Apache redirect calls (/*) to index.html. If you have some api eg. /api just exclude it.