Skip to content

404 for js files when hosting app under a path after the url domain #2549

Closed

Description

@alejoar

OS?

Ubuntu Linux 16.04

Versions.

angular-cli: 1.0.0-beta.15
node: 6.3.1
os: linux x64

Repro steps.

When I'm developing everything works as expected (domain http://localhost:4200) but when I build for production and deploy to my server, I'm don't have the app in the root path, it's something like http://www.mydomain.com/my-ng-app and in this case, the app tries to load the bundles form the root url, obviously getting 404 responses. For example, tries to load http://www.mydomain.com/main.9c5e616854294854119f.bundle.js when that file is actually in www.mydomain.com/my-ng-app/main.9c5e616854294854119f.bundle.js

The log given by the failure.

404 for all .js files.

Mention any other details that might be useful.

I already tried changing <base href="/"> to <base href="/my-ng-app"> but still doesn't work.

Activity

  1. castamir commented on Oct 6, 2016

    @castamir

    change base href from "/" to "" in index.html

  2. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  3. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions