简体   繁体   English

没有index.php时,如何使.php的行为像index.php?

[英]How to make a .php act like index.php when there's no index.php?

Theoretically: You have a cms and an install.php to that. 理论上:您有一个cms和一个install.php。 You want to run the install.php first, and at the end of the steps that would generate and save an index.php before it's deleting itself. 您想先运行install.php,然后在删除index.php之前执行生成和保存index.php的步骤的最后。

The steps of the install.php: install.php的步骤:

  1. lincense agreement 许可协议
  2. php,mysql version check php,mysql版本检查
  3. saving mysql.php 保存mysql.php
  4. saving index.php, deleting install.php, header location:index.php 保存index.php,删除install.php,标题位置:index.php

My question is: How to run install.php automatically when you go to your web page? 我的问题是:当您转到网页时如何自动运行install.php? (Like wordpress' famous 5-minute installation.) (就像wordpress著名的5分钟安装。)

I know that i shouldn't use an installer like this, but it's my homework. 我知道我不应该使用这样的安装程序,但这是我的作业。

In your .htaccess , write- 在您的.htaccess中,输入-

DirectoryIndex install.php index3.php index4.php default.htm

where install.php index3.php index4.php default.htm are general other pages of your directive, by default index2.php gets loaded, if its not present index3.php gets loaded and so on. 其中install.php index3.php index4.php default.htm是指令的其他常规页面,默认情况下会加载index2.php(如果不存在的话)会加载index3.php,依此类推。

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

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