显性 URL 转发:
例如: http://b.com/ 指向 http://a.com/example/ (任意目录);当在浏览器地址栏中敲入 http://b.com/ 后回车,IE 浏览器的地址栏里显示的地址会由原来您敲入的 http://b.com/ 自动变为显示真正的目标地址 http://a.com/example/
隐性URL 转发:
例如:http://b.com/ 指向 http://a
隐性 URL 和显性 URL 的区别
显性 URL 转发:
例如: http://b.com/ 指向 http://a.com/example/ (任意目录);当在浏览器地址栏中敲入 http://b.com/ 后回车,IE 浏览器的地址栏里显示的地址会由原来您敲入的 http://b.com/ 自动变为显示真正的目标地址 http://a.com/example/
隐性URL 转发:
例如:http://b.com/ 指向 http://a.com/example/ (任意目录);当在浏览器地址栏中敲入 http://b.com/ 后回车,IE 浏览器的地址栏里显示的地址保持不变,仍是 http://b.com/ ,但实际访问到的是 http://a.com/xxx/ 的内容。
二级域名,例如设置 bbs.xxx.com,可以访问自动跳转到 xxx.com/bbs,这样对于域名访问,非常直观和方便。而隐性URL,更加适合美观和简短的效果。在二级域名访问前,需要做二级域名的解析和绑定,最后是在框架入口文件ThinkPHP.php 书写跳转代码,下面是我的ThinkPHP.php的二级域名跳转代码
$domain = $_SERVER['HTTP_HOST']; if ($domain == "xxxx.com") { echo '<link rel="Shortcut Icon" href="/ask/favicon.ico">'; echo ' <frameset framespacing="0" border="0" rows="0" frameborder="0"> <frame name="main" src="http://xxxx.com/ask/Index/index.html" scrolling="auto" noresize> </frameset>'; //header("location:http://xxxx.com/ask/Index/index.html"); } else if ($domain == "xxxx.com") { // header("location:http://xxxx.com/baike"); echo ' <frameset framespacing="0" border="0" rows="0" frameborder="0"> <frame name="main" src="http://xxxx.com/baike" scrolling="auto" noresize> </frameset>'; } else if ($domain == "hc.3bkstore.com") { // header("location:http://xxxx.com/hc"); // if($_SERVER['HTTP_HOST'] == $domain){ echo ' <frameset framespacing="0" border="0" rows="0" frameborder="0"> <frame name="main" src="http://xxxx.com/hc" scrolling="auto" noresize> </frameset>'; echo ' <noframes> <body> <ul> 您的浏览器可能不支持框架页面. <li>此页面为提供域名的转向功能,与站点{$target}无关. <li>如此转向页面指向到有害内容,请联络<a href="#">域名转向服务提供商</a>删除 </ul> </body> </noframes> '; } else if ($domain == "xxxx.com") { // header("location:http://xxxx.com/baike"); echo '<title>网络聊天室</title>'; echo '<link href="chat/favicon.ico" rel="shortcut icon">'; echo ' <frameset framespacing="0" border="0" rows="0" frameborder="0"> <frame name="main" src="http://xxxx.com/chat" scrolling="auto" noresize> </frameset>'; } else if ($domain == "case.3bkstore.com") { // header("location:http://xxxx.com/baike"); echo ' <frameset framespacing="0" border="0" rows="0" frameborder="0"> <frame name="main" src="http://xxxx.com/case/Index/index.html" scrolling="auto" noresize> </frameset>'; }