网站运营
位置:首页>> 网站运营>> Godaddy添加默认文档

Godaddy添加默认文档

 来源:asp之家 发布时间:2010-04-16 13:00:00 

标签:Godaddy,文档,国外服务器

用户使用Godaddy的windows的主机,打开网站时必须在域名后添加index.aspx才可以打开。index.aspx不在默认页面里面,你可以加一个index.htm 然后加一个转向在里面转向到index.aspx就可以了,可以用下面的代码转向,把网址修改为index.aspx就可以了。
<META http-equiv=”Refresh” content=”0;URL=http://www.xxxxxx.com/bbs”>
<Script language=”JavaScript”>
window.top.location.replace (“http://www.xxxxxx.com/bbs”) ;
</Script>

一般不建议使用JAVASCRIPT做转向, 因为某些浏览器不支持某些JAVASCRIPT代码,也有些用户会因为安全原因禁用脚本,这样的话客户就无法访问到INDEX.ASPX了,所以用301做服务器转向比较合适。代码如下:
asp:

<%
Response.Status=”301 Moved Permanently”

Response.AddHeader “Location”, “https://www.aspxhome.com/”

Response.End

%>
——————————–
Php:

header(”HTTP/1.1 301 Moved Permanently”);
header(”Location:https://www.aspxhome.com/);
exit();
————————————–
ASP.NET:

<Script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(“Location”,“https://www.aspxhome.com/”);
}
</Script>
如果是使用.NET2.0的话,还可以用WEB.CONFIG来作URL重写或转向

0
投稿

猜你喜欢

手机版 网站运营 asp之家 www.aspxhome.com