kma_999
kma_999

Reputation: 23

301 redirect - with parameters

Hello this is my htaccess

RewriteEngine On
RewriteCond %{QUERY_STRING} page=philosophie
RewriteRule ^index\.php$ http://www.example.ch/buero.html [R=301,L]

I want to redirect

/index.php?page=geschaeftsleitung to /buero.html

but with my rule I get http://www.example.ch/buero.html?page=philosophie

How can I rewrite the rule so that I didn't get ?page=philosophie in the end of the new link?

Upvotes: 1

Views: 30

Answers (1)

Amit Verma
Amit Verma

Reputation: 41219

Try :

RewriteEngine On
RewriteCond %{QUERY_STRING} page=philosophie
RewriteRule ^index\.php$ http://www.example.ch/buero.html? [R=301,L]

"?" at the end of the rewrite target removes the query string.

Upvotes: 1

Related Questions