Aller au contenu

Forcer https sur dokuwiki

Featured Replies

Posté(e)

Bonjour,

j'ai mis en place un dokuwiki sur mon NAS, activé https pour les webapps et j'accède donc à dokuwiki en https.

Maintenant j'imerais forcer l'utilisation de https; soit refuser le http soit le rediriger en https. Comment faire cela?

Merci,

Jean

Posté(e)

Crée un fichier .htaccess avec le contenu suivant à la racine de dokuwiki :

RewriteEngine On
RewriteCond !{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 

Posté(e)
  • Auteur

Bonjour,

désolé j'ai un peu trainé à relire le thread...

j'ai bien ajouté ce fichier sous /volume1/web/dokuwiki mais aucun effet: je peux toujours utiliser du http.

Il y a aussi un fichier .htaccess.dist avec à la fin:

## If you enable DokuWikis XML-RPC interface, you should consider to
## restrict access to it over HTTPS only! Uncomment the following two
## rules if your server setup allows HTTPS.
RewriteCond %{HTTPS} !=on
RewriteRule ^lib/exe/xmlrpc.php$      https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

J'ai donc décommenté les 2 lignes mais pareil :-(

Une autre idée?

Merci,

Jean

Posté(e)
  • Auteur

Bonjour,

J'ai résolu mon pb : en fait je pensais que HTTP_HOST et REQUEST_URI étaient des variables connues par le parser mais il semblerait que non, du coup en forçant les noms de mon site ça marche:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://192.168.0.1/dokuwiki/$1 [R,L]

 

Rejoindre la conversation

Vous pouvez publier maintenant et vous inscrire plus tard. Si vous avez un compte, connectez-vous maintenant pour publier avec votre compte.

Invité
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Répondre à ce sujet…

Qui est en ligne (Afficher la liste complète)

  • Il n’y a aucun utilisateur enregistré actuellement en ligne

Account

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.