2015-07-06 3 views
10
This distribution is not configured to allow the HTTP request method that was used for this request. The distribution supports only cachable requests. 

Ich habe die Website so konfiguriert, nur https auf erstaunlichen Cloudfront akzeptieren. Auf den Punkt gebracht haben Sie eine PHP-Login-Formular, und bei erfolgreicher Anmeldung wird der Benutzer wie folgt umgeleitet:Diese Verteilung ist nicht konfiguriert, um die HTTP-Anfrage zuzulassen

if(isset($_POST['login'])){ 

[...] 
     echo "<script>window.open('coursePayment.php?crs_id=$crs_id','_self')</script>"; 

unten ist die Form:

<form style="margin-top:-20px" method='post' action='' class='form-horizontal' role='form'> 
     <input type="hidden" id="couponCodeLogin" name="couponCodeLogin"> 
     <input type="hidden" id="couponCodeLoginAmount" name="couponCodeLoginAmount"> 
<br><br> 
<div class="group">  
      <input type='text' class='form-control' name='email' required> 
     <span class="highlight"></span> 
     <span class="bar"></span> 
     <label>Email</label> 
    </div> 

    <div class="group">  
      <input type='password' class='form-control' name='pass' required> 
     <span class="highlight"></span> 
     <span class="bar"></span> 
     <label>Password</label> 
    </div> 


      <h5 style="color:#FF6400; cursor:context-menu; margin-top:0px" class="displayForgotPassword">Forgot your password? Click here to retrieve it.</h5><br> 
      <input type='submit' id='moreInfoButton' name='login' value='Continue' class='btn btn-danger'>        
      </form> 

Antwort

12

Was der Fehler versucht, Ihnen zu sagen ist, dass Sie POST nicht verwenden können. Gehen wir davon aus, dass cachefähig GET in diesem Kontext bedeutet. Sie müssen die Cloud-Front konfigurieren, um "Upload-Anfragen" wie POST, PUT usw. zuzulassen. In diesem Fall wird die Anfrage an den Ursprung gesendet, den Cloudfront verwendet.

Aws docs: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-creating.html

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-creating-console.html

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html

Look for erlaubt HTTP-Methoden in den letzten Link.

+0

Wie Wolkenfront konfigurieren ?? Ich bin nicht in der Lage, Post und Put-Anfrage hinzuzufügen ... –

+1

aktualisierte Antwort mit Links zu Doc, die gehen, obwohl, wie Sie dies in der AWS-Konsole tun – Mircea

5

Endlich haben wir die Webseite, wo wir http Methoden ändern können. enter image description here

Danke, Sanjay Salunkhe

Verwandte Themen