Tester les paramètres GET ?Lang=en dans le RewriteRule

G
GauSte
Guest
Bonjour,
Je désire rediriger un ancien site vers les nouvelles pages, en tenant compte des paramètres, du type :

index.php --> art1.html
index.php?Lang=en --> art2.html
index.php?Lang=de --> art3.html

Comment écrire la règle ? Je n'arrive à prendre en compte QUE index.php dans les règles.
 
G
GauSte
Guest
OK, il faut utiliser QUERY_STRING, à combiner avec l'option [S=n] (Skip)
Ce qui donne en simplifié pour moi :

Code:
RewriteEngine on
RewriteBase /team/gite/

# Si pas ANGLAIS, saute cette section
RewriteCond %{QUERY_STRING}   !^Lang=en
RewriteRule ^(.+)\.php        $1\.php   [S=2]
RewriteRule ^index.php$       http://boisroche.team-santonum.com/art78.html [R=301,L]
RewriteRule ^VisiteGrand.php$ http://boisroche.team-santonum.com/art34.html [R=301,L]	

# Si pas ESPAGNOL, saute cette section
RewriteCond %{QUERY_STRING}   !^Lang=es
RewriteRule ^(.+)\.php        $1\.php   [S=2]
RewriteRule ^index.php$       http://boisroche.team-santonum.com/art79.html [R=301,L]	
RewriteRule ^VisiteGrand.php$ http://boisroche.team-santonum.com/art80.html [R=301,L]	

...

Pour de nombreuses redirections, on peut bien sûr allonger le saut par SKIP.
 
Discussions similaires
Haut