Yii module implements the method of binding level two domain name, yii level two domain name
Yii module implementation of binding level two domain name is mainly the following steps:
First in the configuration file settings:
' Urlmanager ' = = Array (' urlformat ' = ' path ', ' showscriptname ' = false,//note false do not enclose ' urlsuffix ' = ' = ' in quotation marks. HTML ', ' rules ' = = Array (' http://test.jb51.net ' =>array ('/blog ', ' urlsuffix ' = ", ' casesensitive ' =>false), ),
Blog for a module, if there is a second controller under the blog module (here comment For example), you need to write a rule, as follows:
' Urlmanager ' = = Array (' urlformat ' = ' path ', ' showscriptname ' = false,//note false do not enclose ' urlsuffix ' = ' = ' in quotation marks. HTML ', ' rules ' = = Array (' http://test.jb51.net ' =>array ('/blog ', ' urlsuffix ' = ", ' casesensitive ' =>false), ' http://test.jb51.net/comment-
' =>array ('/blog/comment/', ' urlsuffix ' = '. html ', ' CaseSensitive ' =>false)
,
To access a blog under the URL of a comment will be: http://test.jb51.net/comment-1.html
This is the case with the local server:
First, in the Yii configuration is not enough, but also in the DNS server to the Test.jb51.net two-level domain name to the program server, can be added in the hosts last
127.0.0.1 www.jb51.net test.jb51.net
Second, you also need to add the http.conf in the Apache server:
Namevirtualhost *:80
ServerAdmin kane@jb51.netdocumentroot e:/wamp/www/k1029servername Test.jb51.netErrorLog logs/test.jb51.net-error_logcustomlog logs/test.jb51.net-access_log Common
If you need to bind more than one level two domain name, simply add it again.
Two-level domain name binding problem
You consult your host vendors have, some hosts do not support sub-domain binding, there is a check your program inside the set is correct! For both of these reasons!
In normal terms, you can achieve the requirements you say! Hope to your question help, if there is any doubt can hi online consulting, it elite club sincerely for your answer!
Wu Fudong [authoritative expert]
How to configure a two-level domain name for YII framework
You can have a ferry, please.
http://www.bkjia.com/PHPjc/840744.html www.bkjia.com true http://www.bkjia.com/PHPjc/840744.html techarticle Yii Module Implementation of the method of binding two-level domain name, yii Two-level domain name Yii module to implement binding two-level domain name mainly has the following steps: First in the configuration file settings: ' Urlmanager ' = Array (' Urlforma ...