2016-01-21 59 views
2

我刚刚在家用电脑上安装了ubuntu作为双启动。Apache不加载htaccess,但仍然重写

我有以下路径htaccess的:

/var/www/html/cortana/html/.htaccess 

我使用的是标准的Apache服务器版本现在2.4

我的Zend框架的项目坐落在:

/var/www/html/cortana/html/index.php 

我们通过浏览器中的http://localhost/cortana/html/index.php访问它。

这是我目前的.htaccess

SetEnv APPLICATION_ENV development 
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 
RewriteRule ^.*$ index.php [NC,L] 

现在,当我去index.php并键入<?php echo getenv('APPLICATION_ENV');die()?> 我没有得到任何回应

而且,这里是错误日志:

[Thu Jan 21 03:00:06.542376 2016] [authz_core:error] [pid 5262] [client 127.0.0.1:52981] AH01630: client denied by server configuration: /var/www/html/cortana/html/.htaccess 

然而,它实际上是使用mod重写模块,因为它的处理应用程序中的重定向。另外,如果我完全删除项目HTML目录中的htaccess它仍然有效

我认为这可能是一个Apache配置问题,因为使用/var/www/html根路径中的项目。

任何帮助,为什么它不使用随机提供的htaccess的该项目,将不胜感激

+0

不要把网站放入网站。你只会遇到可能的配置问题和其他.htaccess的影响。 –

+0

@CharlotteDunois你能举一个例子来说明怎么做? – jkushner

+0

@CharlotteDunois我添加了错误日志 – jkushner

回答

0

试着在你.htaccess文件的顶部使用此代码:

order deny,allow 
allow from all 

如果它仍然无法正常工作,请通过.htaccess文件在您项目的根目录下。

编辑:

或者在你的virtualhost配置您可以添加Require all granted。看看this related question