views:

9

answers:

1

Currently, my workflow is to develop locally, and then place on remote server as key intervals. This has worked fine for a while, but since starting to do more AJAX work, I am finding it difficult to work with roots and hosts dynamically, and am having to write redundant code into my JS in order to make the same file work both locally and remotely.

Is there a good way to mimic a URL locally, or even just have each local site have a root level domain address (as apposed to localhost/my-dev-site) using MAMP?

+1  A: 

Use a host file , point it to localhost

You mentioned MAMP, so I am assuming you are using Mac.

go to /etc/hosts and add this line:

127.0.0.1   www.whateveryoururl.com

OR

127.0.0.1   www.whateveryoururl.com whateveryoururl.com
Stewie
okay, assuming that I did this, how can I then see the live version?
Mild Fuzz
uncomment the line in /etc/hosts
Stewie