Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.htaccess: Invalid command 'Allow', perhaps misspelled or defined by a module not included in the server configuration

The Apache version that I used in my local machine is 2.4, when I accessed the url of my application in the browser, I got this error.

/var/www/app/public/.htaccess: Invalid command 'Allow', perhaps misspelled or defined by a module not included in the server configuration

This is the content of my .htaccess file:

SetEnvIf Request_URI ^/SOME_ENPOINT/ noauth=1
SetEnvIf Request_URI ^/auth/ noauth=1

AuthUserFile /var/www/app/.htpasswd
AuthType Basic
AuthName "APP Login"

Require valid-user
Allow from env=noauth

I am thinking that I will remove this line of code below in .htaccess file.

Allow from env=noauth

I already enabled the mod_env module of my apache server.

Is there way to solve this issue but using the environment variable noauth? Thanks :)

like image 921
Michael Avatar asked Oct 15 '25 14:10

Michael


1 Answers

These are legacy access control directives. Either port Order, allow, and deny to "Require" or load the mod_access_compat module in your (non-htaccess) apache config.

like image 122
covener Avatar answered Oct 18 '25 23:10

covener