# 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]
------------------------------------------------------------
程序中使用url_for()方式
模板中示示例 我们还是以CURD方式
<td><a href="<?php echo url_for("curd/edit/id/".$value['bookid'])?>">编辑</a></td>
<td><a href="<?php echo url_for("curd/delete/id/".$value['bookid'])?>">删除</a></td>
下载后在并在apache设置www.app.com 在c:/windows/system
http://www.tjwzjs.cn/queryphp/project/curd/index
是不是可以显示内容了
如果显示了 在framework\config\inc.ini.php 文件中把下面这行内容去掉注释
//$config['html']='.html';//开启.html结尾url
http://www.tjwzjs.cn/queryphp/project/curd/index.html 访问
是不是可以看到内容了
所有链接都带.html结尾了。那我们有时候想不要.html结尾怎么办
<a href="<?php echo url_for("curd/delete/id/".$value['bookid'],true)?>">删除</a>
url_for(url,true);方式 表示不要html结尾
删除会变成这样子
http://www.tjwzjs.cn/queryphp/project/curd/delete/id/2