您的位置 首页 php

在tp5框架中该如何部署二级域名

有些项目要将移动端和PC端分离开来,比如访问xxx.com,展示的是PC端的页面。而访问m.xxx.com,展示的是移动端的页面。本篇文章主要内容是在tp5中配置二级域名,这里分享给有需要的朋友了解一下。

在thinkphp5中可以这样操作:

首先,在application\config.php修改url_domain_deploy为true,如下:

'url_domain_deploy' =>  true

其次,在application\route.php注册域名部署规则。

其中m是子域名,而mobile是模块名.这段表示任何以m为子域名的访问,都会被解析到mobile模块。

<?phpuse think\Route;Route::domain('m','mobile');

如果是在本地配置,要在hosts中添加

127.0.0.1  xxx.com127.0.0.1  m.xxx.com

另外:
在apache或nginx中要配置两个虚拟主机,一个域名为xxx.com,另一个域名为m.xxx.com。根目录都指向public文件夹,但两个的端口号不能相同。

相关教程:PHP视频教程

以上就是在tp5框架中该如何部署二级域名的详细内容,更多请关注求知技术网其它相关文章!

文章来源:智云一二三科技

文章标题:在tp5框架中该如何部署二级域名

文章地址:https://www.zhihuclub.com/5529.shtml

关于作者: 智云科技

热门文章

评论已关闭

27条评论

  1. Doxazosin is indicated to treat the symptoms of benign prostatic hypertrophy, which may include urinary frequency, urgency, and nocturia, among other symptoms

  2. Experiments done to determine if fixation has effects on mound formation suggest that the final morphology of mounds may be induced by glutaraldehyde fixation

  3. Neck and facial swelling Dyspnea Cough Physical examination will show distended jugular veins Chest x ray may reveal mediastinal widening or right hilar mas Most common cause is lung cancer particularly small cell lung cancer

  4. As scientists learn more about the human genome and each individual s particular genetic make up, the creation of diagnostic tests and targeted therapies specific to the individual will allow oncologists to better target treatments and predict prognosis Kidney problems In a middle aged woman who consumed kudzu root juice to promote health and well being for 10 days, and without evidence of any other causes

  5. According to another aspect of the invention, there is provided a method of treating a subject having a tumor, the method comprising I would assume IГў

  6. Following college, Cheryl continued working with people the rest of her life probation officer, public relations director for a telecommunications company GTE Verizon, public affair liaison for an international pipeline company In addition, there was a nonsignificant trend of increased global myocardial fibrosis in male mice expressing Cre recombinase compared with the flox only control Gdf11 fl fl

  7. Using a whole cell assay and nuclear and cytosolic radiobinding experiments with 3 H estradiol as tracer, we have found that SK LU1, SW900, ChaGo K 1, H441, H661, and A549 cells, as well as primary tumors, bind estrogen specifically

  8. However, it did not reduce fatigue post radiation or in patients with head and neck cancers, and some symptoms worsened compared with a placebo 17 27

  9. Am going to 4th cycle of iui with HCG injection and medications like letrozole n duphaston

  10. Although the development of advanced methodologies such as single cell RNA sequencing and single cell tracing molecular barcoding methodologies in relevant preclinical models have significantly improved our understanding of TH and evolution, further studies in immune competent models are necessary in order to map the genomic and epigenetic landscape of these rare drug resistant clones

  11. PMID 35064415 Background Multifocal tumor recurrences in glioblastoma patients are described in 4 14 of cases

  12. Background Tamoxifen is widely used in the therapy for breast cancer and has three major metabolites, N desmethyltamoxifen, 4 hydroxytamoxifen, and endoxifen Don t lose hope, keep the faith, it will happen

  13. Although the mechanism of action of Clomid is unknown, this substance has been reported to possess both antioestrogenic and oestrogenic properties

  14. A Occasionally some of the Botox can migrate beyond the targeted area and affect another muscle

网站地图