方法是利用一個asp文件通過瀏覽器輸入的域名,判定他是要打開那個文件夾里的站點(diǎn),來實(shí)現(xiàn)一個虛擬放置" />

国产成人精品无码青草_亚洲国产美女精品久久久久∴_欧美人与鲁交大毛片免费_国产果冻豆传媒麻婆精东

18143453325 在線咨詢 在線咨詢
18143453325 在線咨詢
所在位置: 首頁 > 營銷資訊 > 建站知識 > 如何實(shí)現(xiàn)輸入域名自動跳轉(zhuǎn)到域名下得到一個文件夾下?

如何實(shí)現(xiàn)輸入域名自動跳轉(zhuǎn)到域名下得到一個文件夾下?

時間:2023-02-26 09:45:01 | 來源:建站知識

時間:2023-02-26 09:45:01 來源:建站知識

如何實(shí)現(xiàn)輸入域名自動跳轉(zhuǎn)到域名下得到一個文件夾下?:目前我使用的是ASP頁面跳轉(zhuǎn),不是太完美,如果有改進(jìn)辦法請聯(lián)系我。

方法是利用一個asp文件通過瀏覽器輸入的域名,判定他是要打開那個文件夾里的站點(diǎn),來實(shí)現(xiàn)一個虛擬放置多個站點(diǎn)。

301跳轉(zhuǎn)版本:

<%if Request.ServerVariables("SERVER_NAME")="http://www.98gu.com" then Response.Status="301 Moved Permanently"Response.AddHeader "Location","http://www.98gu.com/index.php"Response.Endelseif Request.ServerVariables("SERVER_NAME")="blog.98gu.com" then Response.Status="301 Moved Permanently"Response.AddHeader "Location","http://blog.98gu.com/blog/"Response.Endend if%>
如需增加跳轉(zhuǎn)只需要復(fù)制

elseif Request.ServerVariables("SERVER_NAME")="blog.98gu.com" then Response.Status="301 Moved Permanently"Response.AddHeader "Location","http://blog.98gu.com/blog/"Response.End
這段即可,跳轉(zhuǎn)上限根據(jù)虛擬主機(jī)可以綁定多少域名來決定,理論上可以無限增加。

302跳轉(zhuǎn)版本:

<%if Request.ServerVariables("SERVER_NAME")="www.98gu.com" then response.redirect "/index.php" elseif Request.ServerVariables("SERVER_NAME")="blog.98gu.com" then response.redirect "blog/" end if%>
原理是一樣的,對于301跳轉(zhuǎn)還是302跳轉(zhuǎn)還請自己選擇,跳轉(zhuǎn)的缺陷還在思考怎么解決,最好還是多虛擬主機(jī)吧。

關(guān)鍵詞:文件,實(shí)現(xiàn),輸入

74
73
25
news

版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。

為了最佳展示效果,本站不支持IE9及以下版本的瀏覽器,建議您使用谷歌Chrome瀏覽器。 點(diǎn)擊下載Chrome瀏覽器
關(guān)閉