ThinkPHP3 simple settings for pseudo-static and URL rewrite multiple matches
Configure Apacheaccording to the section of the ThinkPHP3.0 manual URL rewrite.
Then place the . htaccess file in the root directory of the Web site, as indicated in the manual
Win2003 Space IIS6 does not support the. htaccess, choose the server of the Linux system as much as possible
?
Rewriteengine Onrewritecond%{request_filename}!-drewritecond%{request_filename}!-fRewriteRule ^ (. *) $ index.php/$1 [QSA,PT,L] Reprint please specify the Source: http://tyllxx.iteye.com
?
?
Although pseudo-static can be implemented with Url_html_suffix, the method here is implemented using the. htaccess file.
The above code can be implemented so that:
Http://serverName/index.php/Blog/read/id/1
Into:
Http://serverName/Blog/read/id/1
?
Then let it become:
Http://serverName/Blog/1.html
?
If you have:
Http://serverName/buy/1.html
Http://serverName/topic/diy.html
How to achieve it?
?
Here is the implementation method: (. html suffix, you add yourself when writing a connection, in Url_html_suffix way, remove the method. html)
?
?
Rewriteengine on rewritecond%{request_filename}!-d rewritecond%{request_filename}!-f RewriteRule ^ (. *) $ index.php/$1 [qsa,pt] rewriterule ^ (. *)/topic/(. *) \.html$ $1/topic/index/index/links/$2 [qsa,pt] Rewriterule ^ (. *)/buy/(. *) \.html$ $1/buy/index/index/id/$2 [qsa,pt,l] Reprint please specify the Source: http://tyllxx.iteye.com
?
This method has been validated, and can only be used by modifying match fields and replacing fields.