jide / clamp

Command Line Apache MySQL PHP
http://jide.github.io/clamp
GNU General Public License v2.0
79 stars 9 forks source link

.htaccess RedirectMatch results in "Invalid command 'RedirectMatch'" #25

Closed alanfluff closed 7 years ago

alanfluff commented 7 years ago

Hi,

I have clamp working AOK but I am seeing in apache.error.log:

[Sun Jun 18 18:45:20.997647 2017] [core:alert] [pid 51008] [client ::1:57746] /Users/me/example.com/.htaccess: Invalid command 'RedirectMatch', perhaps misspelled or defined by a module not included in the server configuration, referer: http://localhost/

if my `.htaccess' file includes:

RedirectMatch 301 ^/info/$ http://example/

This happens even if I simply try to access http://localhost (not /info).

If I comment out the RedirectMatch line (and all following Redirect 301 ... lines) then the site renders AOK.

I have the good .htaccess setting:

<IfModule mod_authz_core.c>
    Require all denied
  </IfModule>
  <IfModule !mod_authz_core.c>
    Order allow,deny
  </IfModule>

as suggested at https://jide.github.io/clamp/.

Is this a known issue, or can I provide more info to perhaps help solve this.

clamp is brilliant ^_^

rqelibari commented 7 years ago

RedirectMatch is part of mod_alias. This module is not loaded by default. Insert the following line into your clamp.json file:

{...
    "apache": {...
        "options" {...
            "loadmodule": {
                ...
                "alias_module": "/usr/libexec/apache2/mod_alias.so",
                ...
            }
        }
    }
}
alanfluff commented 7 years ago

Thanks @rqelibari - I'll go try that now and post back to confirm, cheers! ^_^

alanfluff commented 7 years ago

@rqelibari The only thing was a typo, I edited it into clamp.json not clamp.conf but that aside, WORKED! ^_^ Thank you, clamp is brilliant!