edvman27
Goto Top

.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

Content-Key: 250372

Url: https://administrator.de/contentid/250372

Printed on: April 26, 2024 at 03:04 o'clock

Member: colinardo
Solution colinardo Sep 27, 2014 updated at 18:05:41 (UTC)
Goto Top
Moin,
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.
Grüße Uwe
Member: EDVMan27
EDVMan27 Sep 27, 2014 at 18:06:29 (UTC)
Goto Top
Hallo,

so gehts.
Alternativ geht es auch indem man an das Ende der URL ein ^ anhängt.

www.domain1.de/product.php?id=11 -> www.domain2.de/fenster^

Danke

Stefan