zoukankan      html  css  js  c++  java
  • 二级域名设置解析方法

    w服务商解决域名指向哪个服务器ip,之后请求服务器时,脚本对二级域名进行路由控制,访问指定脚本。

    https://help.aliyun.com/knowledge_detail/39785.html

    http://codeigniter.org.cn/forums/thread-16699-1-1.html

    1-在域名服务商添加A记录指向同IP;

    2-CI applicationconfig outes.php

     1 <?php
     2 defined('BASEPATH') OR exit('No direct script access allowed');
     3 
     4 /*
     5 | -------------------------------------------------------------------------
     6 | URI ROUTING
     7 | -------------------------------------------------------------------------
     8 | This file lets you re-map URI requests to specific controller functions.
     9 |
    10 | Typically there is a one-to-one relationship between a URL string
    11 | and its corresponding controller class/method. The segments in a
    12 | URL normally follow this pattern:
    13 |
    14 |    example.com/class/method/id/
    15 |
    16 | In some instances, however, you may want to remap this relationship
    17 | so that a different class/function is called than the one
    18 | corresponding to the URL.
    19 |
    20 | Please see the user guide for complete details:
    21 |
    22 |    https://codeigniter.com/user_guide/general/routing.html
    23 |
    24 | -------------------------------------------------------------------------
    25 | RESERVED ROUTES
    26 | -------------------------------------------------------------------------
    27 |
    28 | There are three reserved routes:
    29 |
    30 |    $route['default_controller'] = 'welcome';
    31 |
    32 | This route indicates which controller class should be loaded if the
    33 | URI contains no data. In the above example, the "welcome" class
    34 | would be loaded.
    35 |
    36 |    $route['404_override'] = 'errors/page_missing';
    37 |
    38 | This route will tell the Router which controller/method to use if those
    39 | provided in the URL cannot be matched to a valid route.
    40 |
    41 |    $route['translate_uri_dashes'] = FALSE;
    42 |
    43 | This is not exactly a route, but allows you to automatically route
    44 | controller and method names that contain dashes. '-' isn't a valid
    45 | class or method name character, so it requires translation.
    46 | When you set this option to TRUE, it will replace ALL dashes in the
    47 | controller and method URI segments.
    48 |
    49 | Examples:    my-controller/index    -> my_controller/index
    50 |        my-controller/my-method    -> my_controller/my_method
    51 */
    52 
    53 //$route['default_controller'] = 'welcome';
    54 
    55 switch($_SERVER['HTTP_HOST']){
    56     case 'admin.w.cn':
    57         $route['default_controller']='ww';
    58         $route['view/(:any)'] = 'ww/view/$1';
    59         break;
    60     default:
    61         $route['default_controller'] = 'blog';
    62         break;
    63 }
    64 
    65 
    66 $route['404_override'] = '';
    67 $route['translate_uri_dashes'] = FALSE;
  • 相关阅读:
    ThinkPHP 小于5.0.24 远程代码执行高危漏洞 修复方案
    Nginx负载均衡配置与负载策略
    【高级】PHP-FPM和Nginx的通信机制
    快手、抖音、微视类短视频SDK接入教程,7步就能搞定
    我是怎么一步步用go找出压测性能瓶颈
    一个域名引发的血案……
    开发效率太低?您可能没看这篇文章
    想熟悉PostgreSQL?这篇就够了
    tee命令
    linux下常用的日志分析命令
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6369640.html
Copyright © 2011-2022 走看看