getting URL from Route: breaks in localhost subdirectory
Drupal 8 is very smart to detect in which environment it is running. If you have this path

/mySite/dir1/dir2/dir3/myAlias


then Drupal is installed in /mySite, but the root of the webserver is still in /.

If you want to get rid of /mySite you have to point your webserver at this directory. Usually you define a vhost with this path and choose a local sub domain, which is configured in the nameserver or your local host file.

With a correct configured vhost there shouldn't be any problems.

See https://httpd.apache.org/docs/current/vhosts/