My Facebook application is displaying ‘Method Not Allowed’

If you are encountering this problem with your Facebook application hosted on your SiteGround hosting account, then your application is most likely based on HTML.

By default POST is not within the allowed methods for HTML files because that language cannot process POST queries. Even though Facebook are aware of this, their API is structured to always execute a POST query to the target URL to validate its availability. When the target is HTML, it is highly likely to encounter the "Method Not Allowed" error.

In order to prevent facing this error you need to change the way Apache handles requests to HTML files. The most commonly used method is to force HTML files to be handled by PHP. You can do this by creating an .htaccess file in your application's main directory, and adding the following line:

AddHandler application/x-httpd-php52 .html .htm .shtm

If you are having difficulties applying this fix to your Facebook application, hosted on a SiteGround hosting account, please feel free to contact our Technical Support Team and we will apply the required modifications for you.

You find this article useful? Click here to learn more about SiteGround web hosting experts and what else we can do for you!

  • 50 Users Found This Useful
Was this answer helpful?

Related Articles

What to do if your website has been marked by Google as harmful

If you see the following warning when you visit your site: This site may harm your computer....

HTTP error codes explained

There are multiple HTTP codes that you may come across. Below you can find a summary of the most...

Cannot modify header information – headers already sent by …

If you receive a warning on your pages similar to the one below: "Warning: Cannot modify header...

I’m getting a ‘MySQL server has gone away’ error in my application

There are two main reasons for this error message to show: 1) The MySQL query you are trying to...

Error: Sessions directory is not writable

By default, such an error is received when you use a custom php.ini file and the directive...