How to setup htaccess in MAMP

I battled with this quite a bit. First I installed MAMP PRO and setup a couple of local sites. Everthing worked flawlessly. This include htaccess files in the root folder of each website which worked properly without a hitch. Then my MAMP PRO trial expired. My sites stopped working. I began to setup new sites which worked flawlessly with little effort BUT my htaccess was not working!

A couple of Issues with MAMP PRO and MAMP

Lets talk about a couple of issue that I found with MAMP and MAMP PRO. First I installed a database in MAMP PRO for one of the site. Everything worked great. After the 15 day trial ended, I had no option but to use MAMP. Found out that the database I created no longer existed! I had to recreated that database (and setting up virtual host also from scratch) and it start to work. But what happened to my database. Did it got deleted, was it a bug in MAMP PRO that automatically deleted the the DB I had created. Well that was not the case. What I found MAMP and MAMP PRO or different products (sort of) even though both were working under the same port in my case (http:8888 and mysql:8889), they were really accessing sites esp different databases. Even both database has different users. Interestingly both database were setup on same localhost and same port!

MAMP PRO Still works even after Trial Period has expired

This was surprising for me (a pleasant one). Even though the trial period had expired, I could actually access MAMP PRO Gui. In the top navigation bar, there appears a blue elephant icon. Click on it and you access MAMP PRO GUI as well start and stop services. I was also able to access my old MAMP PRO sites that I had setup (and thought they were not working anymore).

Interesting thing is, if I start MAMP PRO and access PHPMYADMIN, I would see the old database. If I stopped MAMP PRO server and started MAMP, I would see the new database I had setup (the old one does not show). Similarly each database had different user setup (with different password). Interesting both use 8889 ports.

Confusion between MAMP and MAMP PRO

In short it seems like there is a big confusion between MAMP and MAMP PRO although we may not realized it. This basically makes things more complex esp if we do not know how the two products works together. After the trial period of MAMP PRO expires, the databases that were created are gone. One has to setup new databases. Also one has to setup new virtual hosts as well from scratch. There is surprising twist that MAMP PRO still works even after it is expired which many might now know or expect.

How to make htaccess work

There are couple of posts on SO that address this question. I played with all these setting but it did not work for me. Let me try to provide some basic troubleshooting tips which might be helpful if you tried many different things.

  1. Make sure, your htaccess is named .htaccess and not htaccess.
  2. Make sure it is sitting in the root directory of your site.
  3. Create a basic redirect rule and make sure it works. This basically insures that your htaccess did get kicked in

If the above test passes, then all are set. If not you have to fix it to make sure your .htaccess files does kicks in when routing.

This entry was posted in Tutorials/Tips and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s