顯性 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>';
}