Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/252.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在ubuntu 14.04中启用mod_重写模块后,如何配置htaccess文件?_Php_Apache_.htaccess_Ubuntu_Mod Rewrite - Fatal编程技术网

Php 在ubuntu 14.04中启用mod_重写模块后,如何配置htaccess文件?

Php 在ubuntu 14.04中启用mod_重写模块后,如何配置htaccess文件?,php,apache,.htaccess,ubuntu,mod-rewrite,Php,Apache,.htaccess,Ubuntu,Mod Rewrite,我已经安装了apache2,然后启用mod_rewrite模块,如下所示: sudo a2enmod rewrite 启用后,我对这些行感到困惑,我不知道该如何处理它们,因为我知道我要处理这些行的原因是“找到下面的部分,将表示AllowOverride的行从“无”更改为“全部”。 <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowO

我已经安装了
apache2
,然后启用
mod_rewrite
模块,如下所示:

sudo a2enmod rewrite
启用后,我对这些行感到困惑,我不知道该如何处理它们,因为我知道我要处理这些行的原因是“找到下面的部分,将表示AllowOverride的行从“无”更改为“全部”。

<Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
</Directory>
在这两个文件中,我都找不到上面需要编辑的行

我在这个目录中编辑了文件
/etc/apache2/apache2.conf
,但它仍然不起作用

我在
/var/www/html/project_name
目录下工作,那么为什么它会给我403个禁止的错误

当我在这个
/var/www/html/info.php
中打开info.php时,它会显示php信息,工作正常。每当我切换到我的项目目录,它都会给我403个禁止的错误


仍然
.htaccess
未运行。它给了我403个禁止的错误。

你有
/etc/apache2/conf/
文件夹吗?或者
/etc/httpd/
?我有
/etc/apache2/
apache2
中包含以下文件夹:
conf-available
con-enabled
mods-available
mods-enabled
站点可用
站点已启用
并且它包含以下文件:
apache2.conf
我认为其他三个文件并不重要
000-default.conf 
default-ssl.conf