Posted by: Vijay Modi | March 31, 2007

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 <%=MM_editAction%>.
  • 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

Responses

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

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

Hi Jb,

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

Regards,
Vijay Modi

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

Thank you!

interesting thank you…

no luck

Thank You!!!!!

new super sites
good worck baby
senks

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

hi,

Thanks for your solution.This solution helped me alot.

Thanks & Regards,
satya veni

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

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

Thanks

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?

sdfsdf

Leave a response

Your response:

Categories