Enabling htaccess Use under OSX 10.5 (Leopard)

You may have some basic functionality of htaccess for Apache 2 in Leopard, but you won't be able to have any of the useful features (files, filematch, mod_rewrite, etc). To enable an override of htaccess you'll need to edit 2 config files. Launch Terminal and....

sudo pico /etc/apache2/httpd.conf
(enter your password when prompted)

Hit ctrl-w to do a search, type htaccess, and hit enter.
The first instance will have a line saying AllowOverride None. Change this to AllowOverride All.
Press ctrl-x (exit), y (save), enter.

Now enter: sudo pico /etc/apache2/users/YOUR_USERNAME_HERE.conf
Do the same thing (replace None with All, save and exit.)
Go to System Preferences->Sharing. Uncheck "Web Sharing" and check it again (restart Apache).
You now have standard control and functionality of htaccess.

Comments

Mike's picture

For YOUR_USERNAME_HERE.conf, what should be the path in the Directory line?

Thanks.

Mike

Charlie's picture

Been a long time since I messed with this, but probably /Users/YOUR_USERNAME_HERE/Sites

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.