j'essaie de renvoyer les anciens url vers les nouveaux par un 301
Le htaccess normale :
CODE
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 :
CODE
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 :
CODE
RewriteRule ^index.php?page-(.*)&ref=(.*)$ /page-(.*)-$2.html [R=301]
RewriteRule ^page-(.*)-ref-(.*)\.html$ /index.php?page=$1&ref=$2 [L]
RewriteRule ^page-(.*)-ref-(.*)\.html$ /index.php?page=$1&ref=$2 [L]
Mais rien ca marche pas.
Je suis bloqué....
edit :
J'ai mis ca :
CODE
RewriteCond %{QUERY_STRING} ref=([0-9]+)
RewriteRule ^(.*)$ http://www.site.com/page-mot1-mot2-ref-%1.html [L,R=301]
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