Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Troubleshooting › Clicking PayPal checkout gets HTML error 405
- This topic has 8 replies, 3 voices, and was last updated 7 years, 2 months ago by pca.
-
AuthorPosts
-
September 20, 2017 at 9:01 am #14429pcaParticipant
When clicking on the cart’s Checkout with PayPal button, I get: HTTP Error 405.0 – Method Not Allowed. The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.
The URL is [http://mydomain.com/wp?eStore_checkout=process&eStore_gateway=paypal]
If I change the URL in the browser address field to add a / before ? like:
[http://mydomain.com/wp/?eStore_checkout=process&eStore_gateway=paypal]
then it redirects to PayPal successfully. I am running on a GoDaddy Windows server running IIS8. My WordPress Home and Site URLs are both set to [www.mydomain.com/wp/]
What am I doing wrong that is causing the eStore cart to create an invalid URL on the FORM’s action parameter? And how do I fix?
September 20, 2017 at 11:55 am #76464wzpModeratorPlease post the “real” URL of your site; along with instructions for a specific test case, so that we can observe the issue.
September 20, 2017 at 5:02 pm #76465pcaParticipant[http://puliclub.org/wp/events/national-specialties/2017-tennessee-national/2017-national-specialty-raffle2/]
Scroll down to one of the 4 “products” and click Add to Cart. Then click Checkout with PayPal. Assuming you get the error also, you can insert a / just before the ? and the redirect to PayPal works.
Originally, I had set Dashboard > Settings > General Settings > WordPress Address to [http://puliclub.org/wp] and the same for Site Address. Everything on the site was working until this error.
So I changed both above addresses to have a trailing / after wp, but WordPress would not save that. I even added the following to wp-config.php:
define('WP_HOME','http://puliclub.org/wp/');
define('WP_SITEURL','http://puliclub.org/wp/');but that did not fix the problem.
September 20, 2017 at 6:44 pm #76466wzpModerator[http://puliclub.org/wp?eStore_checkout=process&eStore_gateway=paypal]
Most likely causes:
- The request sent to the Web server used an HTTP verb that is not allowed by the module configured to handle the request.
- A request was sent to the server that contained an invalid HTTP verb.
- The request is for static content and contains an HTTP verb other than GET or HEAD.
- A request was sent to a virtual directory using the HTTP verb POST and the default document is a static file that does not support HTTP verbs other than GET or HEAD.
Is your server using page caching, a CDN, or other security setting that does not allow HTTP POST requests? If you don’t know the answer, please ask GoDaddy.
September 21, 2017 at 2:01 am #76467pcaParticipantRegarding POST, the site was originally written using classic ASP where there are many working forms with method=”POST”. And there are many WordPress plugins that use POST and they all work on this server.
I also checked with GoDaddy tech support. This hosting account does not have any page caching, CDN or other settings that would block POSTs. Also, I do not have any WP caching plugins installed.
As you can see from the URL that shopping cart posted, there was an attempt to pass parameters to the directory /puliclub.org/wp, but with no trailing /, this looked like a page named wp. If the POST had been to /puliclub.org/wp/ (with a trailing /), then IIS would have looked for one of the standard default pages like index.html, index.php etc. and when finding one of those, would have loaded that and passed the parameter string to that page.
So that redirect works when the action URL refers to a directory with trailing /.
Looking at a post by dnesmith at
https://support.tipsandtricks-hq.com/forums/topic/invalid-http-verb-on-checkout
the user found source which I have not yet found:
<div class="eStore_cart_checkout_button">
<form action="<homepage>?eStore_checkout=process&eStore_gateway=manual" method="post">
<input type="hidden" name="eStore_gateway" id="eStore_gateway" value="manual">If I could find the php source similar to above that generates the page that is failing, I would change it to append a / after the homepage directory and before the ? paramater string. This would fix my problem.
But I assume the real problem is not with the eStore code, but my server environment. I had hoped by changing the WP HOME or SITEURL variables to have the trailing / after wp, I would fix the problem, but WP would not allow me to make that change.
When all of the production .ASP pages have been rewritten to WP and plugins like WP eStore, I plan to change to a Linux server, but for now I’m stuck with IIS. So I’m hoping we can find a fix for the current environment. Thanks.
September 21, 2017 at 2:21 am #76468adminKeymasterCan you get the specific error from the server log? That will give us clue as to which action the server is not liking.
September 21, 2017 at 5:56 pm #76469pcaParticipantI try not to modify purchased apps and plugins, but I am running out of ideas. Could you tell me what php file is running when I click on Check out with PayPal? I can add the / to the URL and it is likely to work on my server.
Note the requested URL is domain.tld/wp followed by ? and parameters. But I am running on a GoDaddy shared Windows server running IIS, and I do not have the ability to create rewrite rules. So IIS looks for a page wp inside the root HTML directory. But what we want is for IIS to look inside the /wp/ directory, where it would find WordPress’ index.php and all would be well.
This could be made to work, as is, if I could create IIS rewrite rules, but I can’t on this shared server. I could also make it work if I could modify the eStore code that generates this redirect to PayPal.
I suspect the eStore code works perfectly on 99+% of the servers, including IIS configured to rewrite the URL to append the / after the /wp directory. I do plan to move to a Linux server running Apache in the future, but I am stuck on IIS for now.
Could you point me to the eStore php script that is invoked when I click on the “Check out with PayPal” that is placed when I use the shortcode [wp_eStore_cart_when_not_empty] or [wp_eStore_cart]?
That would cover me until I can move to another server, when I would remove that mod.
September 21, 2017 at 6:08 pm #76470pcaParticipantCorrection — I can add rewrite rules to the web.config file. I am so used to Linux and Apache that I forgot this about IIS.
This solution would be better than modifying eStore code. Will try and report results.
September 21, 2017 at 7:31 pm #76471pcaParticipantProblem solved. The redirect to PayPal is now successful.
Fix was to create a rewrite rule in the IIS web.config file to append a / to the WordPress directory (here named /wp) when eStore did not include that:
`<system.webServer>
<httpErrors errorMode=”Detailed” />
<asp scriptErrorSentToBrowser=”true”/>
<rewrite>
<rules>
<rule name=”SpecificRewrite” stopProcessing=”true”>
<match url=”^wp$” />
<action type=”Rewrite” url=”wp/” />
</rule>
</rules>
</rewrite>
</system.webServer>`
-
AuthorPosts
- You must be logged in to reply to this topic.