Centos htaccess not being read

后端 未结 5 1755
终归单人心
终归单人心 2021-02-05 22:44

I\'m working on a new server and I installed via yum the \"Web Server\" group. Php and mysql work fine but I can\'t get .htaccess to work.

Heres my test .htaccess file:<

5条回答
  •  被撕碎了的回忆
    2021-02-05 23:21

    Make sure AccessFileName set to .htaccess

    Search httpd.conf for AccessFileName directive. It defines name of the distributed configuration file:

    grep -i AccessFileName httpd.conf
    

    Make sure users are allowed to use .htaccess file

    What you can put in these files is determined by the AllowOverride directive. This directive specifies, in categories, what directives will be honored if they are found in a .htaccess file. If this directive is set to None, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem.

    grep -i AllowOverride httpd.conf
    

    When this directive is set to All, then any directive which has the .htaccess Context is allowed in .htaccess files: AllowOverride All

    Save and close the file. Restart httpd:

    service httpd restart
    

提交回复
热议问题