对于没有子目录绑定的空间想开多个站的代码
[重要通告]如您遇疑难杂症,本站支持知识付费业务,扫右边二维码加博主微信,可节省您宝贵时间哦!
对于没有子目录绑定的空间想开多个站的代码
将以下代码存成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 %>
仔细看看哈。。。。。可以根据自己使用调节哈!
问题未解决?付费解决问题加Q或微信 2589053300 (即Q号又微信号)右上方扫一扫可加博主微信
所写所说,是心之所感,思之所悟,行之所得;文当无敷衍,落笔求简洁。 以所舍,求所获;有所依,方所成!