我在apache中的文件夹有一个问题,一些文件夹正确地显示html代码,但另一些文件夹显示代码,我不想看到代码,我在该文件夹中创建的任何文件都会显示代码,如您在下一个示例中所见:
https://www.midominio.net/rsarchivos/gabriel.html
在任何其他文件夹中,我都可以看到正确的代码,例如:
https://www.midominio.net/admin/gabriel.html
这是你在下面的代码中看到的唯一的html代码:
<!DOCTYPE html>
<html>
<head>
<title>
Hola Mundo
</title>
</head>
<body>
<p>Hola Mundo</p>
</body>
</html>
在此文件或任何其他标记中不调用任何其他库。有什么建议可以解决这个问题吗?
发布于 2018-07-12 21:20:19
所有的问题是我保存了一个.htaccess文件,并将其隐藏在受影响的目录中。我只要删除那个文件,问题就解决了!
感谢社区的帮助!
发布于 2018-07-11 03:40:23
检查apache虚拟主机或主配置:
/etc/apache2/sites-enabled/000-default
<Directory /var/www/your-project/>
Options Indexes FollowSymLinks MultiViews
DirectoryIndex index.php
DirectoryIndex index.html
AllowOverride None
Order allow,deny
allow from all
</Directory>
在子文件夹中添加.html DirectoryIndex以呈现html。
https://stackoverflow.com/questions/51270010
复制相似问题