分享

写回答

发帖

[提问] 根目录不能写,怎么办啊

回答|共 27 个

lwbo1987

发表于 2011-4-28 09:42:05 | 显示全部楼层

回复 10# 的帖子

不是,可以参考301转向代码合集

JJ2008JJ

发表于 2011-4-28 10:01:31 | 显示全部楼层

我的是windows主机
原代码是asp
是不是只要把下面的代码放到index.asp里面就可以了,其他源代码还需要加代码吗?
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.idcspy.com"
%>

另外还需要其他设置吗?

lwbo1987

发表于 2011-4-28 10:06:48 | 显示全部楼层

回复 12# 的帖子

不需要了

JJ2008JJ

发表于 2011-4-28 10:17:13 | 显示全部楼层

这代码放在index.asp哪个位置?

我放到最上面,出现500错误。

301重定向后,输入 www.abc.com   可以直接进入www.abc.com/xy/ 了吗?

[ 本帖最后由 JJ2008JJ 于 2011-4-28 10:19 AM 编辑 ]

lwbo1987

发表于 2011-4-28 10:24:45 | 显示全部楼层

回复 14# 的帖子

是的,一般是放到最上面,楼主的index.asp代码是什么?
RAKSmart

JJ2008JJ

发表于 2011-4-28 10:28:07 | 显示全部楼层

我的代码是,是zblog 1.9的代码

<%@ CODEPAGE=65001 %>
<% 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 (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"

'向导部分wizard
If ZC_DATABASE_PATH="data/zblog.mdb" Then Response.Redirect "wizard.asp?verify=" & MD5(ZC_DATABASE_PATH & Replace(LCase(Request.ServerVariables("PATH_TRANSLATED")),"default.asp",""))

Call System_Initialize_WithOutDB()

'plugin node
For Each sAction_Plugin_Default_Begin in Action_Plugin_Default_Begin
        If Not IsEmpty(sAction_Plugin_Default_Begin) Then Call Execute(sAction_Plugin_Default_Begin)
Next

Dim ArtList
Set ArtList=New TArticleList

ArtList.LoadCache

ArtList.template="DEFAULT"

If ArtList.ExportByCache("","","","","","") Then

        ArtList.Build

        Response.Write ArtList.html

End If

'plugin node
For Each sAction_Plugin_Default_End in Action_Plugin_Default_End
        If Not IsEmpty(sAction_Plugin_Default_End) Then Call Execute(sAction_Plugin_Default_End)
Next

Call System_Terminate_WithOutDB()

%><!-- <%=RunTime()%>ms --><%
If Err.Number<>0 then
        Call ShowError(0)
End If
%>

lwbo1987

发表于 2011-4-28 10:29:47 | 显示全部楼层

回复 16# 的帖子

<%@ CODEPAGE=65001 %>替代成301的代码

JJ2008JJ

发表于 2011-4-28 10:36:58 | 显示全部楼层

还是500错误

lwbo1987

发表于 2011-4-28 10:39:13 | 显示全部楼层

回复 18# 的帖子

自己重新创建一个首页优先级高的首页文件试试,然后将301代码复制到该文件中!

JJ2008JJ

发表于 2011-4-29 10:37:06 | 显示全部楼层

版主,301重定性搞不起来啊,怎么办啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则