Remove index.php on the Apache server access mode
Below I say Apache, how to remove the URL inside the index.php
For example: Your original path is: Localhost/index.php/index
The changed path is: Localhost/index
The mod_rewrite.so module is loaded in the 1.httpd.conf configuration file//configured in Apache
#LoadModule rewrite_module modules/mod_rewrite.so To remove the siren from the front.
2.httpd.conf config file, change the allowoverride none inside to allowoverride all
Note: Be sure to restart the Apache service after you modify it.
2. Add the. htaccess file to the index.php sibling directory (entry file)
Options+followsymlinksIndexignore*/* rewriteengine on # if a directory or a File exists, use it directly Rewritecond %{request_filename}!-f < Span style= "COLOR: #8959a8" > rewritecond %{request_filename} !-d # Otherwise forward it to index.php Rewriterule . index.php
3. Go to config file web.php
Untie the notes from the following paragraph.
/* ' urlmanager ' + [' enableprettyurl ' = ' = ' , ' showscriptname ' = False, ' rules ' = [ ], ], */
Yii Optimized routing Apache configuration (removal of index.php on Apache server access mode)