Yii Series Summary: hide index. php step 1. enable mod_rewrite module of apache ????? Remove the "#" symbol before LoadModulerewrite_modulemodules/mod_rewrite.so ????? Make sure & lt; Directory "..." & gt; & lt Yii Series Summary: hide index. php steps
1. enable the mod_rewrite module of apache
????? Remove the "#" symbol before LoadModule rewrite_module modules/mod_rewrite.so.
????? Ensure "AllowOverride All"
2. add the code to/protected/config/main. php in the project:
-----------------------------------------
'Components' => array (
???????????...
??????????? 'Urlmanager' => array (
????????????????? 'Urlformat' => 'path ',
????????????????? 'Showscriptname' => false, // note that false is not enclosed in quotation marks.
??????????? 'Urlsuffix '=> '.html ',
????????????????? 'Rules' => array (
????????????????????? 'Sites '=> 'site/Index ',
?????????????????),
???????????),
???????????...
???????),
------------------------------------------
3. add the file ". htaccess" in the same directory as the index. php file. the content is as follows :??
----------------------------
Options + FollowSymLinks
??? IndexIgnore */*
??? RewriteEngine on
?
??? # If a directory or a file exists, use it directly
??? RewriteCond % {REQUEST_FILENAME }! -F
??? RewriteCond % {REQUEST_FILENAME }! -D
?
??? # Otherwise forward it to index. php
??? RewriteRule. index. php