How to get htaccess to work on MAMP

前端 未结 5 1301
情话喂你
情话喂你 2020-11-28 07:31

I am trying to get the .htaccess working in MAMP.

The content of the .htaccess is a simple redirect line but it does not work. I am trying

相关标签:
5条回答
  • 2020-11-28 07:44
    1. In httpd.conf on /Applications/MAMP/conf/apache, find:

      <Directory />
          Options Indexes FollowSymLinks
          AllowOverride None
      </Directory>
      
    2. Replace None with All.

    3. Restart MAMP servers.

    0 讨论(0)
  • 2020-11-28 07:47

    I'm using MAMP (downloaded today) and had this problem also. The issue is with this version of the MAMP stack's default httpd.conf directive around line 370. Look at httpd.conf down at around line 370 and you will find:

    <Directory "/Applications/MAMP/bin/mamp">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    

    You need to change: AllowOverride None To: AllowOverride All

    0 讨论(0)
  • 2020-11-28 07:50

    Go to httpd.conf on /Applications/MAMP/conf/apache and see if the LoadModule rewrite_module modules/mod_rewrite.so line is un-commented (without the # at the beginning)

    and change these from ...

    <VirtualHost *:80>
        ServerName ...
        DocumentRoot /....
    </VirtualHost>
    

    To this:

    <VirtualHost *:80>
        ServerAdmin ...
        ServerName ...
    
        DocumentRoot ...
        <Directory ...>
            Options FollowSymLinks
            AllowOverride None
        </Directory>
        <Directory ...>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>
    </VirtualHost>
    
    0 讨论(0)
  • 2020-11-28 07:51

    If you have MAMP PRO you can set up a host like mysite.local, then add some options from the 'Advanced' panel in the main window. Just switch on the options 'Indexes' and 'MultiViews'. 'Includes' and 'FollowSymLinks' should already be checked.

    0 讨论(0)
  • 2020-11-28 07:58

    The problem I was having with the rewrite is that some .htaccess files for Codeigniter, etc come with

    RewriteBase /
    

    Which doesn't seem to work in MAMP...at least for me.

    0 讨论(0)
提交回复
热议问题