ThinkPHP is a free, open-source, fast, and simple object-oriented lightweight PHP development framework. It complies with the Apache2 open-source Protocol and is born for agile WEB application development and simplified enterprise application development. In use
ThinkPHP is a free, open-source, fast, and simple object-oriented lightweight PHP development framework. It complies with the Apache2 open-source Protocol and is born for agile WEB application development and simplified enterprise application development. In use
The result I want is nothing more than removing index. php from the URL path.
First, configure. htaccess
RewriteEngine onRewriteCond % {REQUEST_FILENAME }! -DRewriteCond % {REQUEST_FILENAME }! -FRewriteRule ^ (. *) $ index. php/$1 [QSA, PT, L]
Because I am deployed on apache, I need to find LoadModule rewrite_module modules/mod_rewrite.so In the httpd. conf configuration file to remove the previous # And change AllowOverride None to AllowOverride All.
Currently, access to localhost/product is valid, but/index. php or/index. the paths obtained by php, Article, and U contain indexes. php, that is, localhost/index. php, there is another step, which needs to be done in conf/config. modify or add 'url _ model' => 2,
Because I tried to deploy ThinkPHP-based conist enterprise 2.0. php has such a configuration 'url _ model' => C ('token. false_static '), and TOKEN. the false_static value is set to 1 during initialization, so... The pattern is still 1, PATHINFO pattern.
Deploy in Sina SAE. It does not support. htaccess and only supports its own configuration file config. yaml. Therefore, add the following overwrite format code in config. yaml:
Handle:-rewrite: if (! Is_dir ()&&! Is_file () & path ~ "^ (. *) $") Goto "index. php/$1"