如何通过htaccess的设置默认网站的页面? [英] How to set the default website page through htaccess?

查看:238
本文介绍了如何通过htaccess的设置默认网站的页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前建立在他的托管帐户来自客户端的网站。该网站的地址,由于某种原因不默认为.php文件(即:的index.php)。如果我把index.php文件并没有收到以下错误index.html文件:

I am currently setting up a website from a client on his hosting account. The website address and for some reason doesn't default to .php files (that is: index.php). If I put index.php and there is no index.html file I receive the following error:

如果你觉得你已经达到这页错误,请联系   网站所有者:someemail@example.com如果您是网站所有者,   有可能你已经到达了该网页,因为:IP地址具有   改变。已经有一台服务器配置错误。该网站可能有   被移动到另一台服务器。如果您是此网站的所有者   并没有想到要看到这个页面,请联系您的主机   供应商。

If you feel you have reached this page in error, please contact the web site owner: someemail@example.com If you are the web site owner, it is possible you have reached this page because: The IP address has changed. There has been a server misconfiguration. The site may have been moved to a different server. If you are the owner of this website and were not expecting to see this page, please contact your hosting provider.

他的主机是一个共享的主机上的cPanel。

His hosting is a shared hosting on cpanel.

推荐答案

使用DirectoryIndex指令在你的.htaccess文件

Use the DirectoryIndex directive in your .htaccess file

DirectoryIndex index.php

这篇关于如何通过htaccess的设置默认网站的页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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