ThinkPHP URL rewriting problem. The result I want is nothing more than removing index. php from the URL path. first, configure. htaccessIfModulemod_rewrite.cRewriteEngineonRewriteCond % {REQUEST_FILENAME }! -DRewriteCond % {REQUEST_FI: the result I want is to remove 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.
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"
Configure. htaccess IfModule mod_rewrite.cRewriteEngine onRewriteCond % {REQUEST_FILENAME} first }! -DRewriteCond % {REQUEST_FI...