Burst of Ice
Burst of Ice

Reputation: 386

Angular 5 error 404 when copying dist to webserver

I made a simple Angular 5 cover to say that I'm still constructing this website. ng serve works fine locally, but now I wanted to host this on my schools website here and I get all these 404 resources not found and all I did was copy whats in the dist/ folder after running ng build --prod to the www/ folder on the webserver.

It's angular 5 with this cli version:

 "@angular/cli": "~1.7.1",
"@angular/compiler-cli": "^5.2.0",

I tried to push another one to github-pages and this has the same problem githubpages the repo is repo but it's almost an empty repo.

Upvotes: 2

Views: 2561

Answers (1)

Laiso
Laiso

Reputation: 2650

You need to add --base-href parameter when you build your application, like this:

ng build --prod --base-href /~320255eg/

Where /~320255eg/ represents the path to your application.

Upvotes: 8

Related Questions