I decided to contribute what I ended up doing:
Fist I thought I would give the solution in a Guard associated with my application:
@Injectable({
providedIn: 'root',
})
export class RoutingSchemeGuardService implements CanActivate {
constructor(
) {}
canActivate(_: ActivatedRouteSnapshot) {
if (window.location.href.includes('/#/')){
window.location.replace(window.location.href.replace('/#/','/'))
return false;
}
return true;
}
}
As I realised, only external links would be broken. Internal ones are formed by Angular's router. Then I thought why whould I wait for the router to get triggerred so an alternative is to add it in index.html first thing first in head tag:
<!DOCTYPE html>
<html lang="en">
<head>
<script>
if (window.location.href.includes('/#/')){
window.location.replace(window.location.href.replace('/#/','/'))
}
</script>
......