Add history api middleware. Use absolute paths for assets.