“HTTP 错误 405 -禁止访问资源”问题的不完全解决办法

上一篇 / 下一篇  2010-04-27 12:31:15 / 个人分类:技术文章

1、文件目录权限不够:这多是NTFS文件格式造成的。
     解决办法:
     (1)选择“工具”——“文件夹选项…”,在弹出窗口中点击“查看”,在查看窗口下取消“高级设置”窗口中“使用简单文件共享(推荐)”前面的复选框。然后点击“确定”。
       (2)然后点击你要设置的文件夹的右键,在弹出窗口中选择“属性”——“安全”——“添加”一个“EVERYONE”用户名,并却赋予“完全控制”的权限。

2、IIS解析文件名有关。
     如果A页面通过表单(form)向B页面传递参数,而B页面是以“.htm or .html ”为扩展名的话,通过IIS解析会出现“HTTP 错误 405 -禁止访问资源”错误的提示。原因是静态的文件无法通过IIS解析传递数据。
      解决办法:
      把接受参数的文件的扩展名修改为“.asp or .aspx"


IIS不允许form中的action 不指定文件,像类似method=post action="./" 或action="/test/" 都会提示‘HTTP 405- 资源被禁止’

action方法必须指定文件才行

Because no ACTION attribute is specified in the tag, both Netscape Navigator and Internet Explorer try to make an HTTP POST request to the URI "web/". According to the HTTP RFC (RFC 2068), this is not a valid Request-URI for a POST operation.

To work around this problem, use one of the following methods:

? Redirect from the default document to a different document. In this case, the SOM-enabled document will no longer be the default document. The new default document will just redirect to the SOM-enabled document. For example, if your SOM-enabled document is named MyDefault.asp, the default document (Default.asp) will contain only the following code.

Use client-side script. to make sure that the file name is included in the URL. If you must use your SOM-enabled document as the default document, use a client-side code block that is similar to the following code block as the first code block within the <HEAD> section of the page. This code block does the following location replacement.



这是IIS 5.0的一个缺陷,我们在提交页面时应该注意,你所要提交信息的页面是不是输入完整了!

比如:新云的后台登陆默认是http://127.1.0.0/admin/admin_login.asp,但是我们为了方便起见将他改成了http://127.1.0.0/admin/index.asp 由此一来,我们在输要登陆时就省略了index.asp;直接输入:http://127.1.0.0/admin,这本身并没有错,但是IIS5.0在这里就不支持了,如果在这里出现了,HTTP 错误 405 - 禁止访问资源,我们只需在再将后面的index.asp补上,再登陆就OK了!!!

另外还有一种情况就是:要提交信息的页面被嵌另一个网页时.

如:(我们按上面的例子说明一下) 我们在另一个网页http://127.1.0.0/dl.asp 中 嵌入http://127.1.0.0/admin/index.asp 这个页面;但是嵌入里面却只填了 http://127.1.0.0/admin 面表并没有什么两样,但是结果却会出现上面同样的问题!这时你也只需修改一下嵌入代码里的网址就OK了!

TAG:

 

评分:0

我来说两句

Open Toolbar