如何制作默认页面 home.php 而不是 index.html 和 index.php [英] how to make default page home.php instead of index.html and index.php

查看:46
本文介绍了如何制作默认页面 home.php 而不是 index.html 和 index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有网站 http://mywebsite.com 如果我点击这个 URL,它将 index.php 和 index.html 作为默认页面.如何将 home.php 设为默认页面.我已经尝试过这个,但没有通过将以下代码放在 public_html 的 .htaccess 文件中来工作

I have website http://mywebsite.com If I hit this URL it take index.php and index.html as default page. How can I make home.php as default page. I have tried this but not working by placing following code inside .htaccess file of public_html

DirectoryIndex home.php index.html index.php

推荐答案

你只需要在你的 DirectoryIndex 中使用 home.php 来让它工作.请记住,这是在根项目的 .htaccess 文件中使用的:

You just need home.php in your DirectoryIndex to make it works. Remember that this is using in .htaccess file of your root project:

DirectoryIndex home.php

这篇关于如何制作默认页面 home.php 而不是 index.html 和 index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆