http://localhost redirects to an external website [closed]

Solution 1:

Okay, I figured it out. The problem was my browser was caching 301 - permanent redirects indefinitely (which is expected behaviour).

Clearing those caches solved it. My apache settings and configs where okay. At some point localhost had pointed to gitlab, but that redirect was deleted upon clearing the caches.