Method Not Allowed / The requested method POST is not allowed for the URL

Really a very interesting and common problem I found today. The solution is more interesting than the Problem.

This error can occur in several situations. The following list includes some of the most common reasons developers encounter this issue:

The action attribute of a form does not point to an executable script or there is no file specified for the action (in which case, the action field in the Property inspector is blank).
The form’s action attribute points to an HTML file.
A developer saves web pages with an HTM or HTML file extension instead of ASP, PHP, CFM or JSP file extensions, and specifies HTM or HTML as the default file extension in the site definition.
Things to look for when receiving this error:

Specify an action attribute in the form’s Property inspector
The action field cannot be left blank and must specify an executable file. Common valid file types for the form action attribute include ASP, JSP, CFM, PHP, EXE, DLL or CGI. If you use one of Dreamweaver’s application objects—such as an Insert Record or Update Record—you may instead see a variable similar to .
Check file extension of the web page producing the error
The page must have a file extension of ASP, PHP, ASPX, CFM or JSP. If the page has an extension of HTM or HTML, it will need to be renamed with the default extension for the server model specified in the site definition.
Check that the correct page type is specified in the site definition
Check the server model field in the Testing Server category of the site definition. The server model should match the correct language.
Another solution:

PHP: This is almost always due to Apache not being configured to treat the file you are trying to POST to as a CGI script. You can not POST to a normal HTML file; the operation has no meaning.

Please visit to find the solution: http://www.somacon.com/p126.php

One most important thing is that “your web server must support the php, asp or cgi whatever scripting language you are using”. Please check is your web server support the scripting language you are using in your web site else it can generate this error. This is one of the major issue found in various problem. So plz check your web server.

If you feel this blog gives you a proper solution, please post your comments.

Regards,
Vijay Modi

About these ads
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

33 Responses to Method Not Allowed / The requested method POST is not allowed for the URL

  1. Chuck says:

    Thanx, I found the direction helpful in resolution.
    Chuck
    http://www.thebestdealofyourlife.com

  2. jb says:

    Hi,
    I found it interresting but it didn’t resolved my problem yet… The form I’m using (to upload a file) is in a pop-up window (poped from my site). Can this cause the problem?

    thanks

    jb

  3. Vijay Modi says:

    Hi Jb,

    No, thats cannot if you can work with other server pages too.

    Regards,
    Vijay Modi

  4. Barry says:

    Hey, thanks for the info. I followed the link here from linuxquestions.org. Thanks for providing the solution.

    In my case I was using an shtml page which includes a perl script. By sending the form action to the shtml page I can pass the variables to the perl script only if I use GET. If I use POST I get the error message above.

    Do you know if there is any way to pass the variables from a form using POST, to a Perl script that is included in an shtml page?

    If you want to see the example it is here http://www.coldrick.com.au/trivia.shtml which is currently working using GET. If you want to see the results using POST just go to http://www.coldrick.com.au/triviatest.shtml and click any of the buttons in the main body of the quiz area. Once you get the error you will need to highlight the address bar and hit enter to get back to the page as I have disabled back-buttoning to stop people going back and re-trying the same question.

    Any help you can provide would be appreciated.

    Rgds

  5. Syrjirsa says:

    interesting thank you…

  6. Utervevop says:

    new super sites
    good worck baby
    senks

  7. Brian says:

    None of these worked for me. here is the site if you can suggest a fix I’d be very happy.

    http://sun.iwu.edu/~bwathen/intake.html

  8. satyaveni says:

    hi,

    Thanks for your solution.This solution helped me alot.

    Thanks & Regards,
    satya veni

  9. Visitor says:

    Just to mention another reason : do not forget to set the content-type to x-www-form-urlencoded

  10. Ana Azuaje says:

    Hi, I get this error when I try to see a JSP pages.
    Do you know what could be the problem?

    Thanks

  11. Lana Boyd says:

    Hey,

    Your advice helped, thank you. But it did not maked any sence to me. Because I have a html submission forms that had this errors. Which I had for a while. Some of those forms suddenly stop working and giving me the above error. Once I rename the pages to php. It start working. But like I sayd it is not making sense. Because some of my exactly same forms are working as html and some I had to change to php.

    Do you have any explanation to that?

  12. Lindsay says:

    Thanks I have a working website now!

  13. rawan says:

    I agree with you but I have a probem that when i check the code in wamp sever that time it show smtp and prot problem show mail fucntion what that mean I have no exp.. of php not full but i knew basic code of php plz show my problem

  14. Susie says:

    Lana, I had the same thing happen–forms that worked all of a sudden stopped working.

    Could it be that your webhost upgraded the version of PHP? I wonder if the most recent version handles something differently.

  15. This didn’t work for me, are there any other solutions?

  16. Alexwebmaster says:

    Hello webmaster
    I would like to share with you a link to your site
    write me here preonrelt@mail.ru

  17. Josabooba says:

    SORRY FOR SCREAMING – but the easiest thing is this possibly

    you get say…
    ………..method=”post” was not found on this server
    (or get, with quite literally with ” “)

    if you have copied/paste this, try it without the “” so…

    method=post
    or
    method=get

    (i.e. NO “”s)

  18. Classifieds says:

    Yep looks fine – works well!

  19. Erin Kay says:

    I have an e-card script that worked great before I switched hosting companies. Now I can’t figure out what’s wrong. I get this error, ” The requested method POST is not allowed for the URL.”

    Location:
    http://www.tnwcreations.com/cards

    CGI file location:
    http://www.tnwcreations.com/cards/card.cgi

    I am using a Linux server.

    What am I doing wrong? I checked the extension and it’s correct.

    BTW, I LOVE your website, it’s so professional and positive. :D

    Erin Kay

  20. Alyssa says:

    Thank you for this site, it is very helpful.
    I originally had this problem, but after following your advice the problem has now changed & when I hit Submit, it asks me to download the .php file.

    Any idea why?? or how to fix?

  21. Andrea says:

    I had the same problem when my hosting company switched php version. I then commented out the following line in the .htaccess file
    #AddType application/x-httpd-php .php .html
    and replace it with this one
    AddType php5-cgi htm html php

  22. cyhau83 says:

    Thanks. Solved my problem. I’ve been trying to post to a .html and hit this error. Just renamed it to a .php and problem solved.
    Now I have to rename all my documents….

  23. Alvin says:

    Hi there,

    I am having this problem on my web site, I don’t own the server, it is hosted on a hosted site.

    The link to the form is this. http://www.mustangdrivers.be/flandersmustangevent/13FMEregistratieformulier_nl.html

    Can you please explain in simple language what and where I should check?

    Thanks.
    AC
    alvinchocb@yahoo.co.uk

  24. Tom says:

    I have the same problem, but atill I have no solutions. My website is hosted in Oracle server with Apache installed. How can i access the configuration is a mistery, since I don’t work with Oracle. Is there anyone with Oracle server?

  25. read more says:

    Now I am ready to do my breakfast, when having my breakfast coming yet again to read more news.

  26. I was extremely pleased to find this site. I need to to thank you for ones time due to this wonderful read!! I definitely appreciated every little bit of it and i also have you saved to fav to see new things in your site.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s