.htaccess和mod_rewrite出错

pra*_*atz 21 php .htaccess mod-rewrite

我正在尝试使用以下.htaccess值来托管基于php的应用程序.

Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php

RewriteEngine On
RewriteBase /easydeposit
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Run Code Online (Sandbox Code Playgroud)

但是,我一直面临以下两个错误,

[access_compat:error] [pid 25330:tid 27] AH01797: client denied by server configuration: /home/abc/opt/apache/htdocs/xyz/system/
[access_compat:error] [pid 25330:tid 27]  AH01797: client denied by server configuration: /home/abc/opt/apache/htdocs/xyz/private/
[access_compat:error] [pid 25330:tid 27] AH01797: client denied by server configuration: /home/abc/opt/apache/htdocs/xyz/application/
[authz_core:error] [pid 25330:tid 27]  AH01630: client denied by server configuration: /home/abc/opt/apache/htdocs/xyz/.htaccess
Run Code Online (Sandbox Code Playgroud)

我不确定为什么会这样.任何帮助表示赞赏.

Mab*_*age 57

如果您最近升级到版本大于2.2的Apache,则authz_core错误错误可能来自<Document>标记中的httpd.conf或httpd-vhosts.conf文件.mod_authz_core是在Apache 2.3中引入的,并改变了声明访问控制的方式.

所以,例如,而不是2.2的配置方式<Directory>......

    <Directory "C:/wamp">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
Run Code Online (Sandbox Code Playgroud)

OrderAllow指令已被Require指令替换:

    <Directory "C:/wamp">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
Run Code Online (Sandbox Code Playgroud)

来源 http://www.andrejfarkas.com/2012/06/fun-with-wamp-server-and-apache-2-4-2/ http://httpd.apache.org/docs/2.4/upgrading.html


小智 0

您确定您可以覆盖 .htaccess 文件中的选项吗?检查 apache 主配置文件