0 Replies Latest reply on Mar 25, 2007 1:18 AM by Newsgroup_User

    OT: .htaccess files on a Mac

    Level 7
      If you've ever set up .htaccess files and virtual hosts on a Mac, what
      steps did you follow?

      I'm using the preconfigured packaged MAMP (Apache, PHP and MySQL). After
      installing it, I set up my virtual hosts and copied some websites from
      my PC to my Mac, only to discover that my .htaccess files aren't
      functioning. I thought it might have to do with the fact that my
      .htaccess files were created with Notepad.

      But according to this article...

      http://rexselin.wordpress.com/2006/07/28/making-mod-rewrite-and-htaccess-work-on-mac-os-x/

      ....htaccess files don't work on Mac's unless you do the following:


      1) Open the httpd.conf file and uncomment these three lines:

      #LoadModule rewrite_module modules/mod_rewrite.so
      #AddModule mod_rewrite.c
      #AccessFilename .htaccess

      > The 2nd and 3rd lines were already uncommented. The closest I found
      to the first line was the following, which was also uncommented:

      LoadModule rewrite_module libexec/httpd/mod_rewrite.so

      I left it alone.


      2) Change "AllowOverride None" to "AllowOverride All" in both the
      httpd.conf and /private/etc/httpd/users/MyName.conf files.


      3) Restart Apache.


      I did all the above - and it killed all my virtual hosts. I'm using a
      preconfigured package called MAMP. After undoing the changes, I
      restarted my servers with the MAMP icon, but nothing happened. So I went
      into Apple's System Preferences > Web Sharing, and restarted it. That
      restored my virtual hosts.

      That made me wonder if the Apache server that came pre-installed with my
      MacBook Pro is still running. In fact, I wonder if my websites have been
      feeding off the original Apache rather than MAMP's Apache. If so, how do
      I shut it off, without affecting my MAMP programs? What else do I need
      to do to make my .htaccess files work on a Mac? Should I recreate my
      .htaccess files in a native Mac text editor?

      Thanks.

      --
      www.geobop.org - Family Websites
      www.invisible-republic.org - Adult political websites (Mature adults only)