→url() produces wrong path

Yes, mod_rewrite is by default disabled on MAMP, they changed that some versions ago: Broken Images and subpages on Mamp (mod_rewrite was disabled)