Yii module implements the method of binding level two domain name, Yii class two domain name _php tutorial

Source: Internet
Author: User

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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.