tempuser Posted October 5, 2013 Share Posted October 5, 2013 (edited) Bonjour, je ne connais pas le langage utilisé pour le htacess et je ne suis pas arriver un un résultat. Je souhaite insérer ceci Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} ^www.mon_site.com$ RewriteRule ^(.*) http://mon_site.com/$1 [QSA,L,R=301] dans le code htacess qui suit : <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^lesite.fr$ RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] # Images RewriteCond %{HTTP_HOST} ^lesite.fr$ RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L] RewriteCond %{HTTP_HOST} ^lesite.fr$ RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L] RewriteCond %{HTTP_HOST} ^lesite.fr$ 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] RewriteCond %{HTTP_HOST} ^lesite.fr$ 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] RewriteCond %{HTTP_HOST} ^lesite.fr$ 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] RewriteCond %{HTTP_HOST} ^lesite.fr$ 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] RewriteCond %{HTTP_HOST} ^lesite.fr$ 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] RewriteCond %{HTTP_HOST} ^lesite.fr$ 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] RewriteCond %{HTTP_HOST} ^lesite.fr$ RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L] RewriteCond %{HTTP_HOST} ^lesite.fr$ RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L] # AlphaImageLoader for IE and fancybox RewriteCond %{HTTP_HOST} ^lesite.fr$ 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 RewriteCond %{HTTP_HOST} ^lesite.fr$ RewriteRule ^.*$ - [NC,L] RewriteCond %{HTTP_HOST} ^lesite.fr$ RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L] </IfModule> Vous pouvez me dire comment le placer ? Merci, Cordialement Edited October 8, 2013 by tempuser (see edit history) Link to comment Share on other sites More sharing options...
JayLab Posted October 6, 2013 Share Posted October 6, 2013 (edited) Dans ton htaccess tu as :# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again et plus bas :# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again à priori prestashop ne modifie que ce qui est compris entre ces 2 commentaires donc tu peux placer des modifications htacces avant Start ou après stop. Edited October 7, 2013 by JayLab (see edit history) Link to comment Share on other sites More sharing options...
tempuser Posted October 7, 2013 Author Share Posted October 7, 2013 Bonjour, merci mais, lorsque je mets le code indiqué en start et end, ça ne marche pas. Vous dites qu'il faut modifier l'existant ou simplement ajouter le code ci-dessus entre start et end ? Merci, Cordialement Link to comment Share on other sites More sharing options...
JayLab Posted October 7, 2013 Share Posted October 7, 2013 Logiquement :Options +FollowSymlinksRewriteEngine onRewriteCond %{HTTP_HOST} ^www.mon_site.com$RewriteRule ^(.*) http://mon_site.com/$1 [QSA,L,R=301] # ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again Directives xxxxx Directives xxxxx Directives xxxxx Directives xxxxx # ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again Sur le htaccess existant dans www/.htaccess apréés pour le code que tu veux ajouter, ce n'est pas mon domaine. Link to comment Share on other sites More sharing options...
tempuser Posted October 8, 2013 Author Share Posted October 8, 2013 Pourquoi vous dites qu'il faut mettre le code entre start et end et en fait vous le mettez avant le start ? meci Link to comment Share on other sites More sharing options...
lechapelier Posted October 8, 2013 Share Posted October 8, 2013 oui avant le start comme sur l'exemple à l'identique. Link to comment Share on other sites More sharing options...
tempuser Posted October 8, 2013 Author Share Posted October 8, 2013 c'est ok, ça marche. Merci 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