.htaccess RewriteRule mit Get-Parameter
Hallo,
ich dachte ich habe etwas ganz einfaches zum Thema RewriteRules, aber ist nicht so.
Ich möchte
www.domain1.de/product.php?id=10 -> www.domain2.de/buecher
www.domain1.de/product.php?id=11 -> www.domain2.de/fenster
RewriteCond %{QUERY_STRING} ^id=10$
RewriteRule products.php www.domain2.de/fenster [R=301,L]
Nur wird leider www.domain2.de/buecher?id=10 draus.
Was muss ich machen, damit der Query_string NICHT Teil der Ziel-URL wird?
Danke
Stefan
ich dachte ich habe etwas ganz einfaches zum Thema RewriteRules, aber ist nicht so.
Ich möchte
www.domain1.de/product.php?id=10 -> www.domain2.de/buecher
www.domain1.de/product.php?id=11 -> www.domain2.de/fenster
RewriteCond %{QUERY_STRING} ^id=10$
RewriteRule products.php www.domain2.de/fenster [R=301,L]
Nur wird leider www.domain2.de/buecher?id=10 draus.
Was muss ich machen, damit der Query_string NICHT Teil der Ziel-URL wird?
Danke
Stefan
Please also mark the comments that contributed to the solution of the article
Content-Key: 250372
Url: https://administrator.de/contentid/250372
Printed on: April 26, 2024 at 03:04 o'clock
2 Comments
Latest comment
Moin,
die RewriteRule-Zeile müsste dann so aussehen
http://httpd.apache.org/docs/current/mod/mod_rewrite.html
Grüße Uwe
die RewriteRule-Zeile müsste dann so aussehen
RewriteRule products.php www.domain2.de/fenster [R=301,QSD,L]
http://httpd.apache.org/docs/current/mod/mod_rewrite.html
qsdiscard|QSD Discard any query string attached to the incoming URI.