可以到http://www.queryphp.com/ 下载pdf版 也有在线版 去除index.php测试在本地虚拟一个域名www.app.com C:\WINDOWS\system32\drivers\etc\hosts文件添加一行 内容如下 127.0.0.1 localhost 192.168.0.10 www.app.com192.168.0.10的是你自己apache使用的IP,就是下面<VirtualHost *:80> *号中的IP,反证能访问你的本地网卡就可以了http://www.app.com/queryphp/project/index.php/default/index 配置后希望可以变成这样子 http://www.app.com/queryphp/project/default/index.html 记得在inc.ini.php文件里面加多一行 $config['html']='.html'; 或把前面那个//去掉,这样就可以了 虚拟主机配置测试,AllowOverride FileInfo 将会使用.htaccess配置<VirtualHost *:80> <Directory "D:/work"> Order allow,deny Allow from all AllowOverride FileInfo </Directory> DocumentRoot "D:/work" ServerName "www.app.com" </VirtualHost> .htaccess文件: RewriteEngine On# uncomment the following line, if you are having trouble # getting no_script_name to work #RewriteBase /# we skip all files with .something #RewriteCond %{REQUEST_URI} \..+$ #RewriteCond %{REQUEST_URI} !\.html$ #RewriteRule .* - [L]# we check if the .html version is here (caching) RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f# no, so we redirect to our front web controller RewriteRule ^(.*)$ index.php [QSA,L]框架会自动生成html 如果想重新生成就要把现在的html文件删除就可以了
crontab 或者 window定时器去做吧. 建议你可以编写PHP Script 来执行:
php.exe XXXX.php XXXXXX
如果是重写就不叫生成html了。
生成html指生成html文件。PHP可以直接
$filename = './file.html';
$filecnt = ob_get_contents();
if(@$fp = fopen($filename, 'w'))
{
flock($fp, 2);
fwrite($fp, $filecnt);
fclose($fp);
return true;
}
else
{
runlog('error', "File: $filename write error.");
return false;
}
下载pdf版
也有在线版
去除index.php测试在本地虚拟一个域名www.app.com
C:\WINDOWS\system32\drivers\etc\hosts文件添加一行
内容如下
127.0.0.1 localhost
192.168.0.10 www.app.com192.168.0.10的是你自己apache使用的IP,就是下面<VirtualHost *:80>
*号中的IP,反证能访问你的本地网卡就可以了http://www.app.com/queryphp/project/index.php/default/index
配置后希望可以变成这样子
http://www.app.com/queryphp/project/default/index.html
记得在inc.ini.php文件里面加多一行
$config['html']='.html'; 或把前面那个//去掉,这样就可以了
虚拟主机配置测试,AllowOverride FileInfo 将会使用.htaccess配置<VirtualHost *:80>
<Directory "D:/work">
Order allow,deny
Allow from all
AllowOverride FileInfo
</Directory>
DocumentRoot "D:/work"
ServerName "www.app.com"
</VirtualHost>
.htaccess文件:
RewriteEngine On# uncomment the following line, if you are having trouble
# getting no_script_name to work
#RewriteBase /# we skip all files with .something
#RewriteCond %{REQUEST_URI} \..+$
#RewriteCond %{REQUEST_URI} !\.html$
#RewriteRule .* - [L]# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f# no, so we redirect to our front web controller
RewriteRule ^(.*)$ index.php [QSA,L]框架会自动生成html 如果想重新生成就要把现在的html文件删除就可以了