The Yii module implements binding level two domain name basically has the following steps:
First in the configuration file settings:
' Urlmanager ' => array (
' urlformat ' => ' path ',
' Showscriptname ' => false,//note false do not enclose in quotes
' Urlsuffix ' => '. html ',
' rules ' => array (
' http://test.jb51.net ' =>array ('/blog ', ' urlsuffix ' => '), ' CaseSensitive ' =>false),
Blog as a module, if the blog module also exists under the second controller (here to comment as an example), you need to write a rule, as follows:
' Urlmanager ' => array (
' urlformat ' => ' path ',
' Showscriptname ' => false,//note false do not enclose in quotes
' Urlsuffix ' => '. html ',
' rules ' => array (
' http://test.jb51.net ' =>array ('/blog ', ' Urlsuffix ' => ", ' casesensitive ' =>false),
' http://test.jb51.net/comment-<id:\w+> ' =>array ('/blog/comment/', ' Urlsuffix ' => '. html ', ' CaseSensitive ' =>false),
If you want to access a blog under the URL of a comment will be: http://test.jb51.net/comment-1.html
The situation on the ground server:
First, in the Yii configuration is not enough, but also in the DNS server to the Test.jb51.net level two domain name resolution to the program server, you can in the final part of the hosts
127.0.0.1 www.jb51.net test.jb51.net
Second, also need to add in the http.conf of Apache server:
Namevirtualhost *:80
<virtualhost *:80>
ServerAdmin kane@jb51.net documentroot e:/wamp/www/k1029
ServerName test.jb51.net
ErrorLog logs/test.jb51.net-error_log
customlog logs/test.jb51.net-access_log Common
</virtualhost >
If you need to bind multiple level two domain names, you can add them repeatedly.