pembrock
pembrock

Reputation: 133

htaccess redirect to lang page

How can I redirect from

http://host_name.com/booking?param=1&param=2 

to

http://host_name.com/fr/booking?param=1&param=2 

I tried it this way, but it doesn't work

RewriteCond %{HTTP_HOST} ^(.*)\/booking(.*)
RewriteRule ^/booking(.*) /fr/booking$2 [L, R=301]

Upvotes: 0

Views: 87

Answers (1)

Panama Jack
Panama Jack

Reputation: 24448

So you should be able to do this to redirect the query string to a new one.

RewriteEngine On
RewriteCond %{THE_REQUEST} ^GET\ /+booking\?param=([^&\s]+)&param=([^&\s]+)
RewriteRule ^ /fr/booking?param=%1&param=%2 [L, R=302]

Let me know how this works for you.

Upvotes: 1

Related Questions