A brief talk on Thinkphp's URL rewriting and Thinkphpurl
All I wanted was to get rid of the index.php in the URL path.
The first is the configuration. htaccess
Copy the Code code as follows:
Rewriteengine on
Rewritecond%{request_filename}!-d
Rewritecond%{request_filename}!-f
Rewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]
Because I'm deploying on Apache, I need to find LoadModule rewrite_module in the httpd.conf config file modules/mod_rewrite.so remove the previous #, Find allowoverride None and change to allowoverride all.
Now access localhost/product valid, but __app__ or __url__ or you get out of the path contains index.php, that is, localhost/index.php, there is a step, need in conf/ Config.php inside Modify or add ' Url_model ' =>2,
And because I was trying to deploy the thinkphp-based Conist Enterprise Edition 2.0, there was a configuration of ' Url_model ' =>c (' token.false_static ') in config.php, and Token.false_ The value of static is set to 1 at initialization, so ... Mode is still 1,pathinfo mode.
in the Sina SAE deployment , does not support. htaccess, only supports its own profile config.yaml, so add the following rewrite format code to CONFIG.YAML:
Copy the Code code as follows:
Handle
-Rewrite:if (!is_dir () &&!is_file () && path~ "^ (. *) $") goto "index.php/$1"
is not super simple, if you want to learn more about other pseudo-static aspects of knowledge, please read the following article recommended it.
http://www.bkjia.com/PHPjc/917034.html www.bkjia.com true http://www.bkjia.com/PHPjc/917034.html techarticle talking about the URL rewriting of thinkphp, talking about thinkphpurl the result I want is to remove the index.php in the URL path first is the configuration. htaccess Copy the code code as follows: Ifmodule mod_rewrite.c ...