如何解决Z-BLOG程序多域名访问的限制
作者:jere 日期:2010-6-22 10:49:37
曾经试着给自己的站加多域名模式,但是没有成功。后来在ZBLOGGER里看到说静态页面不支持多域名解析,会出现例如RSS订阅错误等等。
最近在网上溜达的时候,偶然之间发现一种实现双域名的方法,贡献出来给大家参考测试一下。
基本发放就是加入一段ASP代码:
<%
if Request.ServerVariables("SERVER_NAME")="www.6666.com" then
response.redirect "6666/"
else if Request.ServerVariables("SERVER_NAME")="www.8888com" then
response.redirect "8888/"
else if Request.ServerVariables("SERVER_NAME")="www.1111.com" then
response.redirect "1111/"
end if
end if
end if
%>
由于本人技术不精,只能提出这种实现双域名的可能,具体有无效果,或者说具体的使用方法还请大大们研究研究,造福万民啊。
Tags: 网络编程 系统优化
您还可以选择:
评论: 10 | 引用: 0 | 查看次数:
回复
uggboots评论于
[2011-7-27 11:25:39]
不错不错 , 支持
谢谢分享解决的东东
我写了一个,更好地,懂点技术的可以拿去修改:
<%
'修改,301定向到主域名
Dim strHOST,goURL
strHOST = LCase(Request.ServerVariables("HTTP_HOST"))'域名转换为小写
if Request.ServerVariables("QUERY_STRING")<>"" then
goURL="http://www.vi0454.com"&Request.ServerVariables("SCRIPT_NAME")&"?"&Request.ServerVariables("QUERY_STRING")&"#from301="&strHOST
else
goURL="http://www.vi0454.com"&Request.ServerVariables("SCRIPT_NAME")&"#from301="&strHOST
end if
if strHOST<>"www.vi0454.com" then
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location",goURL
Response.End
else
end if
%>
任何文章都可以实现重定向。
<%
'修改,301定向到主域名
Dim strHOST,goURL
strHOST = LCase(Request.ServerVariables("HTTP_HOST"))'域名转换为小写
if Request.ServerVariables("QUERY_STRING")<>"" then
goURL="http://www.vi0454.com"&Request.ServerVariables("SCRIPT_NAME")&"?"&Request.ServerVariables("QUERY_STRING")&"#from301="&strHOST
else
goURL="http://www.vi0454.com"&Request.ServerVariables("SCRIPT_NAME")&"#from301="&strHOST
end if
if strHOST<>"www.vi0454.com" then
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location",goURL
Response.End
else
end if
%>
任何文章都可以实现重定向。
其实蛮容易实现的呀,把文章链接用 /logo/xxxx.html 来链接就可以了,这样还可以减少DNS请求.
--
链接做好了.貌似我都没看到你链接的留言啊.
--
链接做好了.貌似我都没看到你链接的留言啊.
快鱼 于 2010-6-27 17:31:42 回复申请链接的留言发了的,不过当时你那的留言要通过审核的,估计你没注意到。呵呵!
jere 于 2010-6-27 17:36:33 回复"把文章链接用 /logo/xxxx.html 来链接就可以了"
其实这个我还真不太明白,详细点,或者来个简短的教程发我邮箱,谢过。
我来说两句
上一篇
下一篇