开发者

server error:405 - HTTP verb used to access this page is not allowed

开发者 https://www.devze.com 2023-03-23 17:52 出处:网络
I have a php Facebook application开发者_JAVA技巧 which I have uploaded in a Microsoft server. When I run the application i get this error. Does anybody know the cause of this ?

I have a php Facebook application开发者_JAVA技巧 which I have uploaded in a Microsoft server. When I run the application i get this error. Does anybody know the cause of this ?

405 - HTTP verb used to access this page is not allowed. The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.


Even if you are using IIS or apache, in my guess you are using static html page as a landing page, and by default the web server doesn't allow POST or GET verb on .html page, facebook calls your page via POST/GET verb

the solution would be to rename the page into .php or .aspx and you should be good to go :)


you can add these lines to the web.config:

<system.webServer>
  <modules>
    <remove name="WebDAVModule" />
  </modules>
  <handlers>
    <remove name="WebDAV" />
  </handlers>
</system.webServer>


In the Facebook app control panel make sure you have a forward slash on the end of any specified URL if you are only specifying a folder name

i.e.

Page Tab URL: http://mypagetabserver.com/custom_tab/


It means litraly that, your trying to use the wrong http verb when accessing some http content. A lot of content on webservices you need to use a POST to consume. I suspect your trying to access the facebook API using the wrong http verb.


I fixed mine by adding these lines on my IIS webconfig.

<httpErrors>
    <remove statusCode="405" subStatusCode="-1" />
    <error statusCode="405" prefixLanguageFilePath="" path="/my-page.htm" responseMode="ExecuteURL" />
</httpErrors>


I've been pulling my hair out over this one for a couple of hours also. fakeartist appears correct though - I changed the file extension from .htm to .php and I can now see my page in Facebook! It also works if you change the extension to .aspx - perhaps it just needs to be a server side extension (I've not tried with .jsp).


Try renaming the default file. In my case, a recent move to IIS7.5 gave the 405 error. I changed index.aspx to default.aspx and it worked immediately for me.


In my case, IIS was fine but.. uh.. all the files in the folder except web.config had been deleted (a manual deployment half-done on a test site).


I got this error when I was using jquery and lib was not present in the given path, once jquery lib is added back error was gone. [File name - calculate.html]


I had this err on the host too (my project was .net core2.1 webapi ) please add this code in web config in host :

<modules>
         <remove name="WebDAVModule" />
</modules>
0

精彩评论

暂无评论...
验证码 换一张
取 消