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

同一空间绑定多个域名而实现访问不同页面的PHP代码

WBOY
Release: 2016-06-13 12:35:47
Original
1235 people have browsed it

switch ($_SERVER["HTTP_HOST"]) { 
    case "www1.aspcn.net": 
        header("location:index1.htm"); 
        break; 
    case "www2.aspcn.net": 
        header("location:index2.htm"); 
        break; 
    case "www3.aspcn.net": 
        header("location:index3.htm"); 
...... 继续添加 ...... 
        break; 

?>

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!