如何样域名访问二级目录但不显示二级目录路径

WBOY
Release: 2016-06-13 12:27:01
Original
1595 people have browsed it

怎么样域名访问二级目录但不显示二级目录路径?
怎么样域名访问二级目录但不显示二级目录路径?
例如我的网站www.abc.com已经指定根目录的index.php
然后我的bbs.abc.com要访问二级目录(bbs)的forum.php
我用
$the_host = $_SERVER['HTTP_HOST'];   //取得当前访问域名
if($the_host == "bbs.abc.com"){
header("Location: ./bbs/forum.php"); 
//确保重定向后,后续代码不会被执行 
exit;
}
这样是能跳转,但网址会显示bbs.abc.com/bbs/forum.php
我想令他显示成bbs.abc.com/forum.php
这应该怎么做?
------解决思路----------------------
这个效果不是更好?

$the_host = $_SERVER['HTTP_HOST'];   //取得当前访问域名<br />if($the_host == "bbs.abc.com"){<br />  include("./bbs/forum.php"); <br />  //确保重定向后,后续代码不会被执行 <br />  exit;<br />}
Copy after login

------解决思路----------------------
没有权限修改Web服务器的配置?只能用PHP实现?

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template