THINKPHP的U函数不支持二级域名吗

浏览:1200 发布日期:2016/04/10 分类:求助交流 关键字: 二级域名 U方法
版本用的tp3.2.3,我先说下几个问题吧。
apache里面二级域名这样写的<VirtualHost *:80>
    DocumentRoot  "f:/wamp/www/"
    ServerName localhost
    ServerAlias www.localhost
    ServerAlias user.localhost
    ServerAlias m.localhost
    ServerAlias app.localhost
    ServerAlias admin.localhost
    ServerAlias *.localhost
</VirtualHost>
在tp/common/config.php里面这样写的  'APP_SUB_DOMAIN_DEPLOY' =>  true,   // 是否开启子域名部署
  'APP_SUB_DOMAIN_RULES'  =>  array(
    'www.localhost' => 'Home',
    'user.localhost' => 'User',
    'm.localhost' => 'M',
    'app.localhost' => 'App',
    'admin.localhost' => 'Admin',

  ), // 子域名部署规则
然后问题来了:
1、如果对应规则左侧的键名全部删除“.localhost”,配置耳机域名就不生效,即使输入admin.localhost出来的还是Home模块和控制器的页面,必须用完整域名才行。这是什么问题?
2、我发现,我的Home/Login/index是登录页,用户登录成功需要跳转到用户中心,那么用户中心在user模块,域名就是user.localhost,但是U方法怎么也过不去,生成的URL居然是“/index.php/User/Index/index.html”,正确的写法应该是“user.localhost/”默认操作之类的就不写了,主要问题还是二级域名之间无法跳转,这个是我哪里出了问题?
最佳答案
评论( 相关
后面还有条评论,点击查看>>