4
votes

I'm using MAMP and I can't get mod_rewrites to work.

After lots of playing with numerous http.conf files and then finally looked at my php_info, there is no mod_rewrite exstension installed.

I opened up the php.ini files in Applications > MAMP > conf > php5.2 & php5.3 and looked at the exstensions and there was no mod_rewrite.so. All I can see is:

extension=imap.so
extension=yaz.so
extension=mcrypt.so
extension=gettext.so
extension=pgsql.so
extension=pdo_pgsql.so
extension=pdo_mysql.so

I added it expecting a stroke of luck - but no joy!

1
Right i've found mod_rewrite is in the loaded modules which leads me back to square 1. - user180386
Uhm, did you forget RewriteEngine on ? - gd1
did you install mod_rewrite when you installed MAMP? Check to make sure that you even included it with your installation, then try simply adding extension=mod_rewrite.so. if that doesnt work, make sure you have rewrite engine on, etc. - alecwhardy

1 Answers

5
votes

I had the same problem and hopefully this will solve it for you.

I added my site in my host file so instead of going through the locahost/..... It had its own url that I redirected to 127.0.0.1. i.e. my host file looked like this

127.0.0.1 mysite.local

I then set up a virtual host in MAMP. You will find the vhosts.conf file in /Applications/MAMP/conf/apache

My host file looks like this

NameVirtualHost *
<VirtualHost *>
    DocumentRoot "/Applications/MAMP/htdocs"
    ServerName localhost
</VirtualHost>

<VirtualHost *>
    DocumentRoot "/Applications/MAMP/htdocs/mysite-folder"
    ServerName mysite.local
</VirtualHost>

Hope that helps :D