Ama*_*ony 4 html php lamp apache2
我安装了apache2.当我输入http:// localhost时,它会转到文件http://localhost/class/index.php.如何将其更改为http://localhost/index.html或任何其他页面?我会找到哪个文件来执行此操作?谢谢!
DirectoryIndex在Apache配置文件(httpd.conf)中找到该指令,或将其添加到.htaccess文件中,如果要将默认索引文件限制为index.html,请将其更改为如下所示:
DirectoryIndex index.html
Run Code Online (Sandbox Code Playgroud)
您还可以包含更多资源,它们将按照给定的顺序使用,例如
DirectoryIndex index.html index.php
Run Code Online (Sandbox Code Playgroud)
如果index.html和index.php都存在,则会首先显示index.html文件.
如果您对httpd.conf文件进行了更改,请不要忘记重新启动Apache.
查看mod_dir文档以获取更多信息.
| 归档时间: |
|
| 查看次数: |
10452 次 |
| 最近记录: |