Home > php教程 > php手册 > body text

二级域名配置:最简单的php二级域名配置

WBOY
Release: 2016-06-21 08:50:23
Original
2084 people have browsed it

配置二级域名首先是重定向的问题
在apache打开对.htaccess的支持后,在网站目录下的.htaccess文件中加入
rewritecond %{HTTP_HOST} xx\.domain\.com$ 
rewriterule (.*)$ /xx/$1
然后在域名提供商那里加入一条DNS A记录就可以完成工作了。
这样访问xx.domain.com,就定位到网站目录xx下。
重定向完毕后,还有session和cookie共享的问题
在php.ini里面找到session.cookie_domain
改为session.cookie_domain =domain.com即可
本文链接http://www.cxybl.com/html/wlbc/Php/20130115/36200.html



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template