Switching between localhost, staging, and production should not be a manual URL-editing task.

If you are testing web apps all day, you probably do this constantly:

Copy a production or staging URL.

Replace the hostname with localhost.

Keep the path.