Adrian Goia
Adrian Goia

Reputation: 171

Redirect URL with parameters to another URL with parameters

Using htaccess, I want to redirect

index.php?page=search&action=go&string=John+Doe

to

search.php?string=John+Doe

but only if page=search and action=go in the first url (string varies)

Any help appreciated, thank you.

Upvotes: 2

Views: 6091

Answers (1)

Abhishek Gurjar
Abhishek Gurjar

Reputation: 7476

Use below rule,

RewriteCond %{QUERY_STRING} ^page=search&action=go&string=(.+?)$
RewriteRule ^ /search.php?string=%1 [R=301,L]

Upvotes: 3

Related Questions