Enable Mod Rewrite on Snow Leopard

After enable Apache and PHP (also installing MySQL) on my macbook, i want to enable mod rewrite (Rewrite engine) .  From wikipedia, Mod rewrite (rewrite engine) described as  software that modifies a web URL‘s appearance (URL rewriting). Rewritten URLs (sometimes known as short, fancy URLs, or search engine friendly – SEF) are used to provide shorter and more relevant-looking links to web pages. The technique adds a degree of separation between the files used to generate a web page and the URL that is presented to the world.

By default, mod rewrite has been enabled. But we need edit some configuration before we can use it.

  1. Go to /etc/apache2/httpd.conf than edit the <Directory /> section. Change AllowOverride to All
        AllowOverride All
  2. Edit /etc/apache2/users/youruser.conf, change to this:
    <Directory "/Users/youruser/Sites/">
    Options Indexes MultiViews FollowSymlinks
    AllowOverride All
     Order allow,deny
     Allow from all
    <Directory "/Users/youruser/Sites/*/">
     Options Indexes MultiViews FollowSymLinks
  3. Done. 🙂

One thought on “Enable Mod Rewrite on Snow Leopard

  1. skoolkaholic

    wow akhirnya bisa juga xD
    nyari di blog luar kaga ada yang berhasil. eh dapetnya dari orang indo juga.
    thankyou 😀


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.