centos的htaccess的不被读取 [英] Centos htaccess not being read

查看:433
本文介绍了centos的htaccess的不被读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个新的服务器上,我安装了通过yumWeb服务器组。 PHP和MySQL的工作很好,但我不能得到的.htaccess工作。

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.

这是我的测试.htaccess文件:

Heres my test .htaccess file:

WASD_TEST_CALL_ERROR

我把这个作为的.htaccess在测试文件夹以及一个index.html页面。 相反,报告错误它继续运行并装入索引页面不显示任何错误。

I put this as .htaccess in a test folder along with an index.html page. Instead of reporting an error it goes ahead and loads the index page without displaying any errors.

感谢

推荐答案

确认AccessFileName设置为.htaccess

Make sure AccessFileName set to .htaccess

搜索httpd.conf中AccessFileName指令。它定义了分布式配置文件的名称:

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

grep -i AccessFileName httpd.conf

请确保用户被允许使用.htaccess文件

Make sure users are allowed to use .htaccess file

什么,你可以把这些文件是由AllowOverride指令来决定。该指令规定,在类别,如果他们被发现在.htaccess文件的指令会受到尊重。如果此指令设置为None,那么.htaccess文件将被完全忽略。在这种情况下,服务器将甚至不试图读取.htaccess文件在文件系统中。

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

在此指令设置为All时,所有具有的.htaccess上下文的指令都允许出现在.htaccess文件: 的AllowOverride全部

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

保存并关闭文件。重新启动httpd的:

Save and close the file. Restart httpd:

service httpd restart

这篇关于centos的htaccess的不被读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆