The result I want is nothing more than removing index. php from the URL path.
First, configure. htaccess
<IfModule mod_rewrite.c> RewriteEngine onRewriteCond % {REQUEST_FILENAME }! -DRewriteCond % {REQUEST_FILENAME }! -FRewriteRule ^ (. *) $ index. php/$1 [QSA, PT, L] </IfModule>
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, the access to localhost/product is valid, but the paths obtained by _ APP _ or _ URL _ or 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.
Deployment in Sina SAE does not support. htaccess, but 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"