0

I'm using MAMP at the moment which is doing great, I've been able to add virtual sites successfully and build from that.

In the root of one of the sites I'm working on I used the following htaccess

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

This removes the trailing .php

This used to work on a local site till I used BitBucket to use that folder as a repository.

I have checked the htaccess on another local site and it works but for this one local site it doesn't. I have tried changing the Virtual Directory too but no luck.

I have checked the Hosts file too.

Is there an issue with using a site in MAMP and Version Control?

ngplayground
  • 20,365
  • 36
  • 94
  • 173

1 Answers1

2

Is there an issue with using a site in MAMP and Version Control?

It has notihng to do with version control. MAMP is just a packaged web server development environment. And since it uses Apache—which is a standard part of any LAMP setup—the simplest solution is to go into the main MAMP Apache config make sure that mod_rewrite.so is enabled.

On my local MAMP setup that file is located here:

/Applications/MAMP/conf/apache/httpd.conf

And there should be a line that reads as follows. Be sure it is uncommented:

LoadModule rewrite_module modules/mod_rewrite.so

Then look for the chunk of configuration connected to your MAMP htdocs/ directory. The configuration should begin with this Directory directive:

<Directory "/Applications/MAMP/htdocs">

And within there should be an AllowOverride section.

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

Make sure that is set to All. Then just stop & start your MAMP servers. The Apache server in MAMP will pick up on the new configuration settings & all should be set at that point.

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103