为什么我在asp.net网站上看​​到403错误 [英] why i see 403 Error in my asp.net website

查看:82
本文介绍了为什么我在asp.net网站上看​​到403错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
抱歉,我在Google上搜索了大约1个小时,但没有得到很好的结果.

我通过asp.net(visual basic.net)创建了一个非常简单的网站,它只是"HELLO WORLD"
然后在主机中发布网站,但是当我使用浏览器启动时,看到403错误(禁止访问).怎么了?

谢谢.

Hello
Sorry i was searching google about 1 hour but i cant get good result .

i create a very simple website by asp.net (visual basic.net) , its just "HELLO WORLD"
and then i publish website in my host , but when i start with browser i see 403 Error(Forbidden). whats wrong ?

Thanks.

推荐答案

这个问题可能有几种不同的原因.以下是一些常见的内容:

首先,您将网站发布到了您的主机上,但是您的主机是否已设置为可以查找您的起始页?例如,通常主机会查找index.htm,index.php,index.asp,index.aspx等.如果找到其中之一,则将其用作默认页面.如果他们找不到它,您可能会收到此错误(通常是404,但实际上取决于主机-如果后备是目录浏览并且您不允许这样做,则可能会收到403).如果这是问题所在,则需要将您的起始页面添加到要查找的页面列表中.一种测试方法是将页面添加到URL的末尾.例如,如果您尝试访问www.foo.com,而您的起始页面是helloworld.aspx,则可以尝试访问www.foo.com/helloworld.aspx,看看是否可行.如果是这样,则您的问题是服务器上的配置问题.在启动页面部分中添加helloworld.aspx页面,您会很方便.

也可能是您使用Visual Studio中的模板之一创建了一个网站.如果是这样,您可能已经选择了一个模板来增加页面的安全性.默认情况下,某些模板不允许匿名查看.这将是您的配置文件中的一个设置,需要进行更改.要弄清楚这种情况,您可以阅读有关安全性的配置设置,也可以从空白模板开始重新尝试发布.

这也可能是您的Web服务器上的设置.您将需要进行设置,并检查是否有任何被锁定的文件夹等.我无法帮助您解决此问题,但您的网络托管服务提供商可以.

最后,您可能试图在没有ASP.NET的服务器上运行ASP.NET页.只有能够处理ASP.NET页的服务器才能运行它们.我不记得这会引发什么错误,但它可能会引发403.

与任何故障排除会话一样,请尝试删除尽可能多的变量.确保它在本地运行,尝试仅将简单的index.htm页上传到您的托管服务提供商,等等.看看是否可以缩小问题的范围.
There could be a few different reasons for this problem. Here are the common ones:

First, you published your site to your host, but is your host set up to look for your start page? For instance, normally hosts look for index.htm, index.php, index.asp, index.aspx, etc. If they find one of those, they will use it as the default page. If they don''t find it, you might get this error (usually 404 but it really depends on the host - you might get 403 if the fallback is directory browsing and you aren''t allowed to do that). If this is the issue, you will need to add your start page to the list of pages to look for. A way to test this would be to add your page to the end of your URL. For example, if you are trying to go to www.foo.com and your start page is helloworld.aspx, you could try going to www.foo.com/helloworld.aspx and seeing if that worked. If it does, your problem is a configuration problem on the server. Add your helloworld.aspx page in the startup page section and you will be good to go.

It could also be that you created a website using one of the templates in Visual Studio. If so, you might have selected a template that adds security to your page. By default, anonymous viewing isn''t allowed in some templates. This would be a setting in your config file that would need to be changed. To figure out if this is the case, you could either read up on config settings for security or you could start over with a blank template and try publishing that.

This also might be a setting on your web server. You will need to go through the settings and check to see if there are any folders that are locked down, etc. I can''t help you with the specifics on this one but your web host provider can.

Finally, you might be trying to run an ASP.NET page on a server that doesn''t have ASP.NET. Only servers that are equipped to handle ASP.NET pages can run them. I don''t remember what error this throws, but it potentially could throw a 403.

As with any troubleshooting session, try cutting out as many variables as possible. Make sure it runs locally, try just uploading a simple index.htm page to your hosting provider, etc. See if you can narrow down where the problem is.


这篇关于为什么我在asp.net网站上看​​到403错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆