PHP Framework queryphp Tutorial: Getting started nine how to get rid of index.php
Remove index.php Test
Add a row to the C:\WINDOWS\system32\drivers\etc\hosts file
The contents are as follows
127.0.0.1 localhost
192.168.0.10 www.tjwzjs.cn
192.168.0.10 is your own Apache use of IP, is the following
* Number in the IP, the proof can access your local network card can be
Http://www.tjwzjs.cn/queryphp/project/index.php/default/index
I want to be like this after configuration
Http://www.tjwzjs.cn/queryphp/project/default/index.html
Remember to gator a line in the inc.ini.php file
$config [' HTML ']= '. html '; or remove the front//, so you can
Virtual Host configuration test, allowoverride FileInfo will use the. htaccess configuration
The virtual host configuration test file is inside the Apache virtual host:
Order Allow,deny
Allow from all
AllowOverride FileInfo?
?
DocumentRoot "D:/work"
ServerName "Www.app.com"
The. htaccess file is placed under the project directory under each item directory, which will access the sibling directory
index.php file
The. htaccess file in the index.php directory:
Rewriteengine on
?
# Uncomment the following line, if you is 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]
------------------------
Use Url_for () mode in the program
Examples shown in the template are we still using the curd method?
"> Edit
The > Delete
Downloaded after and set in Apache www.app.com in C:/windows/system
Http://www.tjwzjs.cn/queryphp/project/curd/index
Is it possible to display the content?
If shown in the framework\config\inc.ini.php file, uncomment the following line
$config [' HTML ']= '. html ';//open. HTML End URL
http://www.tjwzjs.cn/queryphp/project/curd/index.html Access
Can you see the contents?
All links are with the. HTML end. Well, sometimes we want to. What to do with HTML endings
The > Delete
Url_for (url,true); means do not end HTML
The deletion becomes such a child
Http://www.tjwzjs.cn/queryphp/project/curd/delete/id/2?
Original source: http://tjwzjs.cn/news/knowledge/2012/1210/56.html