Any process in which membrane rafts are transported to, or maintained in, a specific location. Membrane rafts are small (10-200 nm), heterogeneous, highly dynamic, sterol- and sphingolipid-enriched membrane domains that compartmentalize cellular processes.