Question: When loading a page using Angular an Apache `myserver.com` everything works fine, when going to a subroute from the main page `myserver.com/credits` by clicking a link it'll work as well. 

However, if I try to go directly to `myserver.com/credits` from the browser navigation bar it'll return a `404 error` message:

![Error Message](https://puu.sh/eBEXr/d4d5effc73.png)

I'm aware that by working with node I can configure this so that it does work, however, my company website runs in an apache server which I have no access to. 

I could make it so the server redirects to the main page `myserver.com` like so:

**.htaccess**

```
ErrorDocument 404 /index.html 

```

However the optimal resolution would be that going to `myserver.com/credits` works outright.

Is there a way to make Apache behave this way? And if so, how?

Answer: 
The answer that solves this question can be found here:

<https://stackoverflow.com/a/22740184/1224232>

I have flagged this question as a duplicate. I have tested it and it works perfectly. 

Special thanks to [Kevin B](https://stackoverflow.com/users/400654/kevin-b "Kevin B") for directing me to the answer, and to [Rajasaur](https://stackoverflow.com/users/56465/rajasaur "Rajasaur") for providing the answer.
Created a .htaccess file in root directory if not exist.
then add the following code in it

```
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# not rewrite css, js and images
RewriteCond %{REQUEST_URI} !\.(?:css|js|map|jpe?g|gif|png)$ [NC]
RewriteRule ^(.*)$ /index.html?path=$1 [NC,L,QSA]

```