時間:2023-02-26 09:45:01 | 來源:建站知識
時間:2023-02-26 09:45:01 來源:建站知識
如何實(shí)現(xiàn)輸入域名自動跳轉(zhuǎn)到域名下得到一個文件夾下?:目前我使用的是ASP頁面跳轉(zhuǎn),不是太完美,如果有改進(jìn)辦法請聯(liá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ī)可以綁定多少域名來決定,理論上可以無限增加。
<%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),輸入
客戶&案例
營銷資訊
關(guān)于我們
微信公眾號
版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。