If you want to get rid of ?q= in your urls, you need to enable clean urls. You can do that from the administer/settings/clean urls. But, before you do that you need ModRewrite enabled on Apache. Here is how you do it:

1. Make invisible files visible.
2. Find the file /etc/httpd/httpd.conf and open it in any text editor, for example the free TextWrangler.
3. Change line 406 from AllowOverride None to AllowOverride All.
4. Save. You will need to give your admin password to rewrite this system file.
5. Open System Preferences/ Sharing/ Services and restart Personal Web Sharing.
6. Enjoy.

Original post: http://creativebits.org/enable_ModRewrite_on_OSX

Comments

iraszl’s picture

Here is another article about how to install Drupal on Mac locally if anybody would like to make comments and corrections please:
http://creativebits.org/install_drupal_locally_on_your_mac

dale42’s picture

I did the following to turn on "Clean URLs" after installing Drupal in an OS X user directory (eg //localhost/~myUserName).

Using the example of installing in an account named: fred

  1. Change AllowOverride All per the above instructions (Wasn't exactly on that line, but close enough).
  2. Edit the /etc/httpd/users/username.conf file (eg, fred.conf).
    10.2 places each account's directory directive in separate files and merges them when Apache is started (This may have changed in 10.3 and 10.4). I stripped everything out leaving it empty, prefering to have everything in the /etc/httpd/httpd.conf file.
  3. Change RewriteBase in .htaccess
    Change the line:
        #RewriteBase /drupal
    to:
        RewriteBase /~username
    eg, For the fred username: RewriteBase /~fred
  4. Restart Apache (per instructions above)