Neil Gee's "Fastest Way of Installing Drupal 7.24 on Mac OS X 10.9 , 10.8, 10.7" guide is a fantastic guide to getting started if you want to get Drupal up and running on Mac OSX Mavericks. His guide on installing mysql, php & phpmayadmin is very clearly written and not too technical. I thoroughly recommend both guides.

My test files are on the Sites directory on my user (/Users/derek/Sites). I have sub directory called client in which I put my test files for any client work. I open my browser and enter http://localhost/~derek/client/lucid and my Drupal installation works. MySQL works. PHP works. Drush works. Everything except clean URL's! It is the one thing has frustrated me with running Drupal on my Mac!!

Go to ?q=admin/config/search/clean-urls and run the Clean URL test and I get, "The clean URL test failed."

The Solution

All the googling I've done hasn't been much help but it has pointed me to the solution.

  1. Go to the home of your Drupal installation ~/Sites/[drupal directory]
  2. Edit the .htaccess file nano .htaccess
  3. Search for the line "RewriteBase /drupal" (use control w in nano to get the search tool)
  4. Insert a newline below and paste the following text (be sure to change your user name and drupal directory) : RewriteBase /~[username]/[drupal directory]
  5. Exit nano (control x and select y to save your changes)

Your clean URL test should work.

Don't forget to comment out the RewriteBase /~[username]/[drupal directory] line when you upload to a production server or you will end up with some 404 error.