分享

写回答

发帖

如何添加默认文档??

回答|共 30 个

大象无形

发表于 2007-10-3 22:26:51 | 显示全部楼层

收录知识库

蚂蚁

发表于 2007-10-4 03:58:46 | 显示全部楼层

ASP,ASP.net程序默认主页最好是Default.asp或Default.aspx

Moeee

发表于 2007-10-5 11:25:28 | 显示全部楼层

原帖由 大漠孤狼 于 2007-8-26 01:08 AM 发表
查过了,index.aspx 不在默认页面里面。可以加一个index.htm 然后加一个转向在里面转向到index.aspx就可以了
可以用下面的代码转向,把网址修改为index.aspx就可以了








    window.top.location.replace ( "http:/ ...


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

Response.AddHeader "Location", "http://www.XXXX.com/"

Response.End
%>
--------------------------------
Php:

header("HTTP/1.1 301 Moved Permanently");

header("Location:http://www.XXXX.com/);

exit();
--------------------------------------
ASP.NET:

<script runat="server">

private void Page_Load(object sender, System.EventArgs e)

{

Response.Status = "301 Moved Permanently";

Response.AddHeader("Location","http://www.XXXX.com/);

}

</script>


如果是使用.NET2.0的话,还可以用WEB.CONFIG来作URL重写或转向

hugokang

发表于 2008-3-25 13:37:00 | 显示全部楼层

这些都要在空间里面操作吗?可以说的详细些吗?
我的也是这样的问题

hugokang

发表于 2008-3-25 13:55:34 | 显示全部楼层

上面的方法,我试了下,好象不管用的哦?
那位高手帮忙详细指点下啊
The page you tried to access does not exist on this server. This page may not exist due to the following reasons:

You are the owner of this web site and you have not uploaded (or incorrectly uploaded) your web site. For information on uploading your web site using FTP client software or web design software, click here for FTP Upload Information.

The URL that you have entered in your browser is incorrect. Please re-enter the URL and try again.

The Link that you clicked on incorrectly points to this page. Please contact the owner of this web site to inform them of this situation.

judy820525

发表于 2008-5-28 11:12:32 | 显示全部楼层

回复 13# 的帖子

究竟谁的对啊,怎么没人做答了呢?!急啊,求好心人帮助,谢谢!!

judy820525

发表于 2008-5-28 11:18:48 | 显示全部楼层

原帖由 hugokang 于 2008-3-25 01:37 PM 发表
这些都要在空间里面操作吗?可以说的详细些吗?
我的也是这样的问题



是啊,在哪里操作,怎么操作,能说明白点吗!谢谢!我是菜鸟。。。

add.c

发表于 2008-5-28 11:28:30 | 显示全部楼层

把首页改为Default.aspx就可以了,把welcome.html删除就好了

judy820525

发表于 2008-5-28 12:23:32 | 显示全部楼层

原帖由 add.c 于 2008-5-28 11:28 AM 发表
把首页改为Default.aspx就可以了,把welcome.html删除就好了




非常谢谢add.c 版主的回答。

我的是 asp的,主机是Godaddy WINDOWS,我按你的意思做了,但现在又出现一下问题,麻烦帮忙看看,谢谢

Server Error in '/' Application.
--------------------------------------------------------------------------------

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

add.c

发表于 2008-5-28 13:34:02 | 显示全部楼层

权限问题,设置好就行了
您需要登录后才可以回帖 登录 | 注册

本版积分规则