欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

YII模塊實(shí)現(xiàn)綁定二級(jí)域名的方法

 更新時(shí)間:2014年07月09日 17:40:16   投稿:shichen2014  
這篇文章主要介紹了YII模塊實(shí)現(xiàn)綁定二級(jí)域名的方法,需要的朋友可以參考下

YII模塊實(shí)現(xiàn)綁定二級(jí)域名主要有如下步驟:

首先在配置文件設(shè)置:

'urlManager' => array(
'urlFormat' => 'path',
'showScriptName' => false, //注意false不要用引號(hào)括上
'urlSuffix' => '.html',
'rules' => array(
'http://test.jb51.net'=>array('/blog', 'urlSuffix'=>”, 'caseSensitive'=>false),
),

blog 為一個(gè)模塊 ,如果在blog模塊下還存在第二個(gè)控制器(這里以comment為例),則需要多寫一個(gè)規(guī)則,如下:

'urlManager' => array(
'urlFormat' => 'path',
'showScriptName' => false, //注意false不要用引號(hào)括上
'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),
),

如要訪問blog下的某一條評(píng)論的URL會(huì)是:http://test.jb51.net/comment-1.html

本在地服務(wù)器的情況:

一、在YII配置中設(shè)置了還不夠的,還需要在DNS服務(wù)器中把test.jb51.net二級(jí)域名解析到程序服務(wù)器,可以在hosts中的最后加入

127.0.0.1    www.dbjr.com.cn   test.jb51.net

二、還需要在apache服務(wù)器的http.conf中添加:

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>

如果需要綁定多個(gè)二級(jí)域名,則只要重復(fù)添加即可.

相關(guān)文章

最新評(píng)論