2011-12-21 52 views
13

我目前正在他的托管帐户上设置一个来自客户端的网站。网站地址和某些原因不会默认为.php文件(即:index.php)。如果我把index.php文件并没有index.html文件,我收到以下错误:如何通过htaccess设置默认网站页面?

If you feel you have reached this page in error, please contact the web site owner: [email protected] 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。

回答

24

使用DirectoryIndex指令中的.htaccess文件

DirectoryIndex index.php 
2

尝试

DirectoryIndex index.php 

如果不工作,你可能必须解决它通过像

提供的index.html
<html><frameset rows="*"><frame src="index.php"></frameset></html> 

(当然更详细)

+0

如果你已经提出了这样的解决方案,帧的使用是绝对没有用的:只需设置相应的''标签的重定向。 – 2016-09-25 08:48:08

3

这个问题是由我的网页浏览器缓存引起的,只要我已经清除了它的缓存,它就可以工作!