Skip to Navigation

Enabling .htaccess - Mac OS X 10.5

Using mod_rewrite is a day-to-day thing when developing modern web applications, especially with frameworks such as CodeIgniter or content management systems like Expression Engine. Enabling this Apache function can be a pain in Leopard, and the guide I normally use needs a little bit of tweaking to get it working.

Editing ‘httpd.conf’

The first step is to modify the global Apache configuration file, located in /private/etc/apache2/httpd.conf, (make sure you back it up first). I recommend getting to the file using Textmate – its much easier than using those horrible Terminal text editors. The file needs to be edited around line 205, changing AllowOverride None to AllowOverride All.

  1. # AllowOverride controls what directives may be placed in .htaccess files.
  2. # It can be "All", "None", or any combination of the keywords:
  3. # Options FileInfo AuthConfig Limit
  4. AllowOverride All

Editing Your User Configuration

The second step is to modify your own user account configuration – You can skip this step if you don’t host your files in the ~/Sites folder. The file is located in /private/etc/apache2/users/username.conf. The file needs to be edited right from the top.

  1. <Directory "/Users/beseku/Sites/">
  2. Options Indexes FollowSymLinks MultiViews
  3. AllowOverride All AuthConfig
  4. Order allow,deny
  5. Allow from all
  6. </Directory>

After making and saving these changes, (you’ll be asked for an administrator password when saving the files through Textmate), you'll need to open the Sharing system preference and restart ‘Web Sharing’, (by un-ticking then ticking the checkbox). If everything went well, Apache should start up again and you should have full mod_rewrite functionality.

There is one comment on ‘Enabling .htaccess - Mac OS X 10.5&rsquo

— Posted by on 24th May, 2008 at 01:05 AM
Thanks for this article (found via Google) -- fixed my issue trying to remove the "index.php" in the URI work with CodeIgnitor

Leave A Comment

Some HTML is allowed, (general text-formatting and linking). Images and complex HTML is not. Abide by the rule ‘I shall think before I speak’ and you’ll be fine.


More About This Entry

The entry ‘Enabling .htaccess - Mac OS X 10.5’ was posted in the ‘long’ category on the 9th May, 2008.

There is one comment on this entry.

You Might Like This

A randomly selected something that you might enjoy. I may have been involved with some of them.

Flickrshow


Stay Up To Date

There are a number of RSS feeds that you can subscribe to if you want to stay up to date with this site.