4

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 :)

1 Answer 1

9

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.

1
  • 2
    Could you share the new directives also? Sep 30, 2021 at 3:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.