Erreur connexion SSL - "HTTP:X-Forwarded-Port" non reconnu
... / "HTTP:X-Forwarded-Port" n...
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

"HTTP:X-Forwarded-Port" non reconnu

Von
CedricV5
Erstellungsdatum 2018-10-19 16:36:05 (edited on 2024-09-04 13:24:42) in Erreur connexion SSL

Bonjour,

Le code suivant donné par @yadutaf d'OVH pour rediriger les requêtes HTTP vers HTTPS avec l'offre OVH SSL Gateway (https://community.ovhcloud.com/community/fr/prestashop-1-6-ssl-gateway?id=community_question&sys_id=d714b5c8b55a0ad0f078da7e5576c9c3) ne fonctionne plus :

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Port} 80
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Concrètement, il ne se passe rien en appliquant ce code dans le fichier .htaccess. Je précise que les redirections Apache fonctionnent très bien pour le reste, c'est juste la variable "HTTP:X-Forwarded-Port" qui ne vaut jamais 80.

Merci d'avance pour votre aide.


2 Antworten ( Latest reply on 2018-10-20 08:48:17 Von
CedricV5
)

```php

echo "

\n";
print_r( $_SERVER );
echo "
\n";

?>
```
tu ne vois plus d'entêtes exploitables dans $_SERVER ?

Merci @kyodev, j'ai trouvé une autre variable en analysant $_SERVER. Voici donc le fichier .htaccess qui fonctionne :

RewriteEngine On
RewriteCond %{HTTP:X-REMOTE-PROTO} ^http$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Antworten sind derzeit für diese Frage deaktiviert.