简体   繁体   English

如何将默认索引设置为index.html

[英]how to set default index to index.html

I am building wordpress site and it's not finished yet. 我正在建立wordpress网站,但尚未完成。 I want to redirect the visitors visiting http://domain.com to http://domain.com/under-construction but i want to be able to see my index.php... 我想将访问http://domain.com的访问者重定向到http://domain.com/under-construction,但我希望能够看到我的index.php ...

I tried changing the names to index.html index.htm default.asp ..... none of them worked. 我尝试将名称更改为index.html index.htm default.asp .....它们都不起作用。

and if I used htaccess it redirected all my pages to index.html so it doesnt work. 如果我使用htaccess它将所有页面重定向到index.html,所以它不起作用。

Any ideas? 有任何想法吗? Thanks... 谢谢...

在您的根博客目录中,将其放置在您的.htaccess文件中:

DirectoryIndex index.html

您可以使用一个插件: http : //wordpress.org/extend/plugins/maintenance-mode/

In /.htaccess write as suggested by Sudhir. 在/.htaccess中,按照Sudhir的建议进行编写。 In /index.php write require('./under-construction/wp-blog-header.php');. 在/index.php中编写require('./ under-construction / wp-blog-header.php');。 No .htaccess in /under-construction/ and in /under-construction/index.php write require('./wp-blog-header.php');. / under-construction /和/under-construction/index.php中没有.htaccess写入require('./ wp-blog-header.php');。 Thats how it works in my case. 那就是我的情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM