建站经验 experience
当前位置:首页 > 网站建设专题 > 建站经验
ZBLOG设置技巧:ZBLOG实现301重定向方法
发布日期:2012-06-19 阅读次数:1166 字体大小:
 今天一直弄博客首页301重定向功能,研究一上午,找了很多的代码也没实现,后来通过一个代码更改了一下就成功了,自己开心一下。
下面把zblog重定向的方法分享给大家,因为zblo个的首页是default.asp,所以事先到空间上将default.asp下载到本地,用记事本打开或者用Dreamweaver打开也可以,找到这段代码:
<% Option Explicit %>
<% On Error Resume Next %>
<% Response.Charset="UTF-8" %>
<% Response.Buffer=True %>
<!-- #include file="c_option.asp" -->
<!-- #include file="function/c_function.asp" -->
<!-- #include file="function/c_function_md5.asp" -->
<!-- #include file="function/c_system_lib.asp" -->
<!-- #include file="function/c_system_base.asp" -->
<!-- #include file="function/c_system_event.asp" -->
<!-- #include file="function/c_system_plugin.asp" -->
<!-- #include file="plugin/p_config.asp" -->
<%
-----------------------------------------------------------------------------------------------------------
if request.ServerVariables("SERVER_NAME")="webjx.com" then 
Response.Status="301 Moved Permanently" 
Response.AddHeader "Location",
http://www.webjx.com/
Response.End
end if   
-----------------------------------------------------------------------------------------------------------
If (InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"text/vnd.wap.wml") > 0) And (InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"text/html") = 0)  Then Response.Redirect "wap.asp"
     将我分割符中间的代码:
if request.ServerVariables("SERVER_NAME")="webjx.com" then 
Response.Status="301 Moved Permanently" 
Response.AddHeader "Location",
http://www.webjx.com/
Response.End
end if 
     加到
<%

If (InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"text/vnd.wap.wml") > 0) And (InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"text/html") = 0)  Then Response.Redirect "wap.asp"
的中间就可以了,顺便说一下,把我的网址http;//www.webjx.com/换成你的网址就可以了。