Hi there,
Thanks for writing in! This will really depend on how your localhost is setup. MAMP and other similar local development environments have their own settings and some are customize-able. If localhost is not working directly, you may want check and see how you are accessing your site in the browser address bar. Is it just localhost/yoursite or is it something like localhost:8080/yoursite or similar. Please try those variations as well and see if it works.
Let us know how that goes. Hope this helps – thanks!