1. Remove the portal script need to rewrite the URL, if your webserver software when Apache, you must configure httpd.conf, search "LoadModule rewrite_module modules/mod_rewrite.so", Then remove the "#" [PS: Comment symbol] in front of this line:
2. In the Yii Web application Master Profile main.php[path\to\protected\config\main.php], use Urlmanager to add an array configuration option ' showscriptname ' = False
1' Urlmanager ' =Array(2' Urlformat ' = ' path ',3' Showscriptname ' =false,//Remove the display of the portal script index.php4' Rules ' =Array(5' post/<id:\d+>/<title:.*?> ' = ' Post/view ',6' posts/<tag:.*?> ' = ' post/index ',7' <controller:\w+>/<action:\w+> ' = ' <controller>/<action> ',8),9),
3. Copy the. htaccess file from the other path of the project to the same level of path as the portal script index.php, overwriting the contents with the following code:
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
For a definition of Apache rewrite rules, see: Http://httpd.apache.org/docs/2.2/en/mod/mod_rewrite.html#rewriterule and/http Www.maxi-pedia.com/FollowSymLinks
Also, if you do not know how to create a file without a file name under Windows, you can create it under a path in the following way:
Yii Removal index.php portal script displayed as SEO friendly URL