Beageek Posted March 16, 2017 Share Posted March 16, 2017 Bonjour j'ai un gros soucis de redirection au lieu de rediriger https://www.domiane.com vers https://domaine.com la redirection passe avant par http://domaine.com pareil pour http://www.domaine.com qui passe par http://domaine.com pour arrive sur https://domaine.com voici l'image de l'outil qui détecte se genre de soucis Je suis financièrement raide , donc avant de m'endetter en faisant appel à un webmaster je tente ma chance ici si quelqu'un a les connaissances et la gentillesse de m'aider d’après planethoster le soucis viens du cms (donc prestashop) mais je ne vois pas de ou... la redirection fonctionne mais elle n'est pas direct et sa pose un gros problème de référencement d’après google merci d'vance Link to comment Share on other sites More sharing options...
Tadaa ! Posted March 16, 2017 Share Posted March 16, 2017 Hello. Doit y avoir deux redirections : 1 de http://www vers http:// ET http:// vers https:// Quel est le contenu du htaccess ? Link to comment Share on other sites More sharing options...
Tadaa ! Posted March 16, 2017 Share Posted March 16, 2017 Ca peut aussi dépendre de l'installation du SSL. Et un webmaster ne travaille pas forcément à 100€/h Link to comment Share on other sites More sharing options...
Beageek Posted March 16, 2017 Author Share Posted March 16, 2017 Merci de la réponse apres plusieurs recherches j'ai trouver se bout de code RewriteEngine on # Redirection vers HTTPS RewriteCond %{SERVER_PORT} ^80$ [OR] RewriteCond %{HTTPS} =off RewriteRule ^(.*)$ https://tshirt-beageek.com/$1 [R=301,L] # Redirection du www vers non-www en HTTPS RewriteCond %{HTTP_HOST} ^www\.tshirt-beageek\.com [NC] RewriteRule ^(.*)$ https://tshirt-beageek.com/$1 [R=301,L] donc peu être que le problème est régler Link to comment Share on other sites More sharing options...
Beageek Posted March 16, 2017 Author Share Posted March 16, 2017 contenu htaccess # ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again # .htaccess automaticaly generated by PrestaShop e-commerce open-source solution # http://www.prestashop.com - http://www.prestashop.com/forums <IfModule mod_rewrite.c> <IfModule mod_env.c> SetEnv HTTP_MOD_REWRITE On </IfModule> RewriteEngine on # Redirection vers HTTPS RewriteCond %{SERVER_PORT} ^80$ [OR] RewriteCond %{HTTPS} =off RewriteRule ^(.*)$ https://tshirt-beageek.com/$1 [R=301,L] # Redirection du www vers non-www en HTTPS RewriteCond %{HTTP_HOST} ^www\.tshirt-beageek\.com [NC] RewriteRule ^(.*)$ https://tshirt-beageek.com/$1 [R=301,L] RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] # Images RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L] RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L] RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L] RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L] # AlphaImageLoader for IE and fancybox RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L] # Dispatcher RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L] #Domain: https://tshirt-beageek.com RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^api$ api/ [L] RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] # Images RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L] RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L] RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L] RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L] # AlphaImageLoader for IE and fancybox RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L] # Dispatcher RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L] </IfModule> AddType application/vnd.ms-fontobject .eot AddType font/ttf .ttf AddType font/otf .otf AddType application/x-font-woff .woff <IfModule mod_headers.c> <FilesMatch "\.(ttf|ttc|otf|eot|woff|svg)$"> Header add Access-Control-Allow-Origin "*" </FilesMatch> </IfModule> <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/gif "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType text/css "access plus 1 week" ExpiresByType text/javascript "access plus 1 week" ExpiresByType application/javascript "access plus 1 week" ExpiresByType application/x-javascript "access plus 1 week" ExpiresByType image/x-icon "access plus 1 year" ExpiresByType image/svg+xml "access plus 1 year" ExpiresByType image/vnd.microsoft.icon "access plus 1 year" ExpiresByType application/font-woff "access plus 1 year" ExpiresByType application/x-font-woff "access plus 1 year" ExpiresByType application/vnd.ms-fontobject "access plus 1 year" ExpiresByType font/opentype "access plus 1 year" ExpiresByType font/ttf "access plus 1 year" ExpiresByType font/otf "access plus 1 year" ExpiresByType application/x-font-ttf "access plus 1 year" ExpiresByType application/x-font-otf "access plus 1 year" </IfModule> <IfModule mod_headers.c> Header unset Etag </IfModule> FileETag none <IfModule mod_deflate.c> <IfModule mod_filter.c> AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript font/ttf application/x-font-ttf font/otf application/x-font-otf font/opentype </IfModule> </IfModule> #If rewrite mod isn't enabled ErrorDocument 404 /index.php?controller=404 d’après vous y a un truc qui va pas et je vais devoir prendre un prestataires ? Link to comment Share on other sites More sharing options...
Beageek Posted March 16, 2017 Author Share Posted March 16, 2017 bon d'apres mon hébergeur c'est encore pire avec ce code car j'ai 3 redirection 301 pour arriver a la page Link to comment Share on other sites More sharing options...
Beageek Posted March 16, 2017 Author Share Posted March 16, 2017 je trouver normal de rediriger https://www , http://www et http:// vers https:// y a une autre façon de faire que d'utiliser 3 redirections ? Link to comment Share on other sites More sharing options...
Tadaa ! Posted March 16, 2017 Share Posted March 16, 2017 Effectivement, il faut tout rediriger vers une URL canonique. Suis pas expert en regex. Pas moyen de clarifier au niveau de la gestion du nom de domaine, directement ? Chez Gandi par exemple, tu peux faire des redirections en amont de PS. Ou demande directement à l'hébergeur quel code tu dois utiliser Link to comment Share on other sites More sharing options...
Beageek Posted March 16, 2017 Author Share Posted March 16, 2017 ils ont chercher mais d'apres eux le soucis viens du cms et ils ne peuvent pas m'aider Link to comment Share on other sites More sharing options...
Beageek Posted March 16, 2017 Author Share Posted March 16, 2017 une question toute bete, vu que les redirections fonctionnent et que j'ai preciser a Google ma version préférer (https://domaine.com) je ne risque rien au niveau duplica etc si ? Link to comment Share on other sites More sharing options...
Beageek Posted March 16, 2017 Author Share Posted March 16, 2017 je viens de voir que dans prestashop > informations l'url de ma boutique est http://tshirt-beageek.com/ ça n'a pas de rapport ? Link to comment Share on other sites More sharing options...
Tadaa ! Posted March 17, 2017 Share Posted March 17, 2017 A priori non, pas de risque de Duplicate puisque les redirections fonctionnent. Pas moyen d'intervenir chez le Registrar ? Peux-tu me donner l'outil qui t'a informé de ces multiples redirections ? Link to comment Share on other sites More sharing options...
Beageek Posted March 17, 2017 Author Share Posted March 17, 2017 J'ai passer la nuit a faire des essai de code de redirection en tout genre mais je n'ai pas reussi a régler le probleme voici le htaccèss comme il est de base # ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again # .htaccess automaticaly generated by PrestaShop e-commerce open-source solution # http://www.prestashop.com - http://www.prestashop.com/forums <IfModule mod_rewrite.c> <IfModule mod_env.c> SetEnv HTTP_MOD_REWRITE On </IfModule> RewriteEngine on #Domain: tshirt-beageek.com RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^api$ api/ [L] RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] # Images RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L] RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L] RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L] RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L] # AlphaImageLoader for IE and fancybox RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L] # Dispatcher RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L] </IfModule> AddType application/vnd.ms-fontobject .eot AddType font/ttf .ttf AddType font/otf .otf AddType application/x-font-woff .woff <IfModule mod_headers.c> <FilesMatch "\.(ttf|ttc|otf|eot|woff|svg)$"> Header add Access-Control-Allow-Origin "*" </FilesMatch> </IfModule> <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/gif "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType text/css "access plus 1 week" ExpiresByType text/javascript "access plus 1 week" ExpiresByType application/javascript "access plus 1 week" ExpiresByType application/x-javascript "access plus 1 week" ExpiresByType image/x-icon "access plus 1 year" ExpiresByType image/svg+xml "access plus 1 year" ExpiresByType image/vnd.microsoft.icon "access plus 1 year" ExpiresByType application/font-woff "access plus 1 year" ExpiresByType application/x-font-woff "access plus 1 year" ExpiresByType application/vnd.ms-fontobject "access plus 1 year" ExpiresByType font/opentype "access plus 1 year" ExpiresByType font/ttf "access plus 1 year" ExpiresByType font/otf "access plus 1 year" ExpiresByType application/x-font-ttf "access plus 1 year" ExpiresByType application/x-font-otf "access plus 1 year" </IfModule> <IfModule mod_headers.c> Header unset Etag </IfModule> FileETag none <IfModule mod_deflate.c> <IfModule mod_filter.c> AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript font/ttf application/x-font-ttf font/otf application/x-font-otf font/opentype </IfModule> </IfModule> #If rewrite mod isn't enabled ErrorDocument 404 /index.php?controller=404 # ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again pour l'outil j'en ai tester plusieurs celui la celui ci encore et la je ne comprends pas pourquoi les http:://www et https:://www passe par http://domaine avant d'aller sur https://domaine je ne sais pas ou est le bug , on me dit dans le cms mais je ne vois pas .. Link to comment Share on other sites More sharing options...
Tadaa ! Posted March 17, 2017 Share Posted March 17, 2017 C'est le htaccess en service actuellement ? Link to comment Share on other sites More sharing options...
Tadaa ! Posted March 17, 2017 Share Posted March 17, 2017 As-tu testé sans tenir compte du https, en mettant juste RewriteCond %{HTTP_HOST} ^www.votre-site.com$ RewriteRule ^(.*) http://votre-site.com/$1 [QSA,L,R=301] Le certificat SSL vient peut-être en surcouche automatiquement. Link to comment Share on other sites More sharing options...
Beageek Posted March 17, 2017 Author Share Posted March 17, 2017 (edited) oui c'est le htaccèss du moment a vrai dire j'ai essayer a peu prés tout les code que j'ai pu trouver sur internet mais vu que je ne comprends pas tout je préfère ne pas trop forcer alors la je viens de remettre ce code dans le htaccess # Redirection vers HTTPS RewriteCond %{SERVER_PORT} ^80$ [OR] RewriteCond %{HTTPS} =off RewriteRule ^(.*)$ https://tshirt-beageek.com/$1 [R=301,L] # Redirection du www vers non-www en HTTPS RewriteCond %{HTTP_HOST} ^www\.tshirt-beageek\.com [NC] RewriteRule ^(.*)$ https://tshirt-beageek.com/$1 [R=301,L] et ça fonctionne très bien , les redirections se font bien , sur les logiciels de test il ne signale plus http://www vers htpp puis https donc ça a l'air d’être bon mais je ne comprends pas pourquoi hier l’hébergeur m'a dit qu'avec ce code c’était pire car il faisait 3 redirection alors que d’après les test tout est bon j'abuse de ta gentillesse Tadaa mais d’après toi c'est propre comme ça non ? Edited March 17, 2017 by Beageek (see edit history) Link to comment Share on other sites More sharing options...
Beageek Posted March 17, 2017 Author Share Posted March 17, 2017 je pense qu'hier j'avais peu etre mal rentré le code car la tout les test de redirection sont bon et ok sur tous les sites Link to comment Share on other sites More sharing options...
Beageek Posted March 17, 2017 Author Share Posted March 17, 2017 j'ai vraiment l'impression que c'est mieux qu'avant car même le back office de prestashop est rediriger en https alors qu'avant non Link to comment Share on other sites More sharing options...
Tadaa ! Posted March 17, 2017 Share Posted March 17, 2017 Tout à l'air de bien fonctionner ^^ Le seul risque que tu courrais était d'être pénalisé pour la lenteur de la réponse serveur, après toutes ces redirections. Mais comme elles fonctionnaient, il n'y avait pas de pb du côté du duplicate. See U Link to comment Share on other sites More sharing options...
Beageek Posted March 17, 2017 Author Share Posted March 17, 2017 (edited) Merci beaucoup pour ton aide, grâce a ton avis je suis plus sur . merci encore ; vraiment donc en ce qui me concerne problème régler grâce a ce code à modifier avec vos paramètres RewriteEngine on # Redirection vers HTTPS RewriteCond %{SERVER_PORT} ^80$ [OR] RewriteCond %{HTTPS} =off RewriteRule ^(.*)$ https://monsite.com/$1 [R=301,L] # Redirection du www vers non-www en HTTPS RewriteCond %{HTTP_HOST} ^www\.tshirt-beageek\.com [NC] RewriteRule ^(.*)$ https://monsite.com/$1 [R=301,L] Edited March 17, 2017 by Beageek (see edit history) Link to comment Share on other sites More sharing options...
Bragh Posted March 24, 2017 Share Posted March 24, 2017 Bonjour bon en fin de compte le code fonctionne mais le htaccèss se met a jour tout seul et suprime le code, donc je me retrouve avec le même probleme de redirection... je ne comprends pas pourquoi le htaccess se modifie tout seul Link to comment Share on other sites More sharing options...
SmartPlugs Posted March 30, 2017 Share Posted March 30, 2017 Si le problème est toujours d'actualité : les lignes ajoutées manuellement au fichier .htaccess doivent bien entendu être ajoutées en dehors du code # ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment ... ... # ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again C'est à dire avant ou après cette portion. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now