Bonjour tout le monde, c'est mon 1er poste ici
j'essaie de renvoyer les anciens url vers les nouveaux par un 301
Le htaccess normale :
RewriteRule ^page-(.*)-ref-(.*)\.html$ /index.php?page=$1&ref=$2 [L]
ca marche impec sauf que chaque page est encore accessible par son encien url.
et lorsque je fait :
RewriteRule ^page-(.*)-ref-(.*)\.html$ /index.php?page=$1&ref=$2 [L,R=301]
J'ai l'inverse ca me renvoie vers l'ancienne page alors je l'inverse comme ca :
RewriteRule ^index.php?page-(.*)&ref=(.*)$ /page-(.*)-$2.html [R=301] RewriteRule ^page-(.*)-ref-(.*)\.html$ /index.php?page=$1&ref=$2 [L]
Mais rien ca marche pas.
Je suis bloqué.... et tout aide est le bien venue
edit :
J'ai mis ca :
RewriteCond %{QUERY_STRING} ref=([0-9]+) RewriteRule ^(.*)$ http://www.site.com/page-mot1-mot2-ref-%1.html [L,R=301]
sa redirige vers cette url :
-http://www.site.com/page-mot1-mot2-ref-112.html?page=mot1-mot2&ref=112
et non pas comme ca :
-http://www.site.com/page-mot1-mot2-ref-112.html