Aide paramétrage fichier htaccess pour migration https
Bonjour
Malgré avoir suivi différent tuto, j'ai un peu de mal à paramétrer mon fichier .htaccess de drupal.
Il y a certaines directives que je ne comprends pas.
Voici le truc, je viens de passer le site www.hengel.com en https étrangement sur mon lieu de travail ça fonctionne et chez moi non.
Quand je saisie dans mon navigateur www.hengel.com et les différentes variantes (hengel.fr, avec ou sans www) ça me redirige bien sur la page https (sur mon lieu de travail).
Par contre si je suis lien dans google (saisir hengel) ça ne me redirige pas pour les url type ww.hengel.com/contenu ...
Voici les différentes variantes pour lesquelles je souhaites obtenir une redirection vers https:www.hengel.com.
http://www.hengel.com
hengel.com
http://hengel.com
hengel.fr
http://hengel.fr
www.hengel.fr
http://www.hengel.fr
blog.hengel.com
J'ai regardé les préconisations pour drupal 7 https://www.drupal.org/https-information qui me préconise de mettre ceci
Code:
1 2 3 4
|
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com*
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301] |
Si je mets ceci en remplacant par www.hengel.com ça me plante le site.
C'est bizarre par défaut pour "RewriteCond %{HTTPS}" j'avais "on".
Pourriez-vous m'aider SVP et me dire ce qui pose problème dans mon htaccess SVP.
Voici ce que j'ai déjà dans mon htacess
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
# Set "protossl" to "s" if we were accessed via https://. This is used later
# if you enable "www." stripping or enforcement, in order to ensure that
# you don't bounce between http and https.
RewriteRule ^ - [E=protossl]
RewriteCond %{HTTPS} on
RewriteRule ^ - [E=protossl:s]
# Make sure Authorization HTTP header is available to PHP
# even when running as CGI or FastCGI.
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Block access to "hidden" directories whose names begin with a period. This
# includes directories used by version control systems such as Subversion or
# Git to store control files. Files whose names begin with a period, as well
# as the control files used by CVS, are protected by the FilesMatch directive
# above.
#
# NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is
# not possible to block access to entire directories from .htaccess, because
# <DirectoryMatch> is not allowed here.
#
# If you do not have mod_rewrite installed, you should remove these
# directories from your webroot or otherwise protect them from being
# downloaded.
RewriteRule "(^|/)\." - [F]
#redirection du .fr vers le .com
RewriteCond %{HTTP_HOST} ^hengel.fr$
RewriteRule ^(.*) https://hengel.com/$1 [QSA,L,R=301]
#redirection du blog vers le .com
RewriteCond %{HTTP_HOST} ^blog.hengel.com$
RewriteRule ^(.*) https://hengel.com/$1 [QSA,L,R=301]
# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# uncomment the following:
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http%{ENV:protossl:s}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#redirection
RewriteCond %{HTTP_HOST} ^www.hengel.fr$
RewriteRule ^(.*) https://www.hengel.com/$1 [QSA,L,R=301]
RewriteCond %{HTTP_HOST} ^hengel.fr$
RewriteRule ^(.*) https://www.hengel.com/$1 [QSA,L,R=301]
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
RewriteBase /
... |
D'avance merci.
Dur d'être développeur et de maîtriser tous les aspects serveurs.