對于沒有子目錄綁定的空間想開多個站的代碼
[重要通告]如您遇疑難雜癥,本站支持知識付費業(yè)務(wù),掃右邊二維碼加博主微信,可節(jié)省您寶貴時間哦!
對于沒有子目錄綁定的空間想開多個站的代碼
將以下代碼存成index.asp就行了
記得是支持ASP的空間才可用的呀!
<%
if Request.ServerVariables("SERVER_NAME")=" www.a.com" then
response.redirect "/default.asp"
else if Request.ServerVariables("SERVER_NAME")=" www.b.com" then
response.redirect "/down/index.asp"
else if Request.ServerVariables("SERVER_NAME")=" www.c.com" then
response.redirect "/movie/index.asp"
else if Request.ServerVariables("SERVER_NAME")=" www.d.com" then
response.redirect "/mtv/index.asp"
else if Request.ServerVariables("SERVER_NAME")=" www.e.com" then
response.redirect "/book/index.asp"
else
response.redirect "404.htm"
end if
end if
end if
end if
end if
%>
子目錄和域名要按自己的情況修改呀
------------------------------------------
<% dim domain domain = Request.ServerVariables("SERVER_NAME") select case domain case " www.a.com" response.redirect "/default.asp" case " www.b.com" response.redirect "/down/index.asp" case " www.c.com" response.redirect "/movie/index.asp" case " www.d.com" response.redirect "/mtv/index.asp" case " www.e.com" response.redirect "/book/index.asp" case else response.redirect "404.htm" End Select %>
仔細看看哈。。。。。可以根據(jù)自己使用調(diào)節(jié)哈!
問題未解決?付費解決問題加Q或微信 2589053300 (即Q號又微信號)右上方掃一掃可加博主微信
所寫所說,是心之所感,思之所悟,行之所得;文當(dāng)無敷衍,落筆求簡潔。 以所舍,求所獲;有所依,方所成!