When generating template path from url, ignore ports and '.local' suffixes

this behaviour will need some documentation too.