
如您所见,我的网站有一个index.php文件,但默认情况下它不会打开它。
我编辑过/etc/apache2/mods-enabled/dir.conf。以下是文件的内容:
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>此问题仅在此文件夹中发生。所有其他文件夹正确打开它们的index.php文件。
发布于 2021-01-31 07:00:11
将index.php文件的名称更改为Index.php。Linux服务器区分大小写.要找到index.html、index.htm或index.php文件名,必须使用所有小写。如果服务器没有找到索引,它将显示一个文件列表。
发布于 2022-04-24 14:15:01
在配置文件中添加以下行:
<Directory /var/www/azgor.com/>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>在我的例子中,配置文件是/etc/apache2/sites-available/azgor.conf。
然后使用以下方法重新启动Apache:
sudo service apache2 restarthttps://askubuntu.com/questions/1312377
复制相似问题