1

Want redirecting all URLs containing Bolivia to www.example.com/US/, e.g:

www.example.com/search.php?country=Bolivia&Select=Ingeni&&Location=Hiller

redirect to www.example.com/US/

Tried this, not work:

RewriteCond %{QUERY_STRING} ^(.+?&)?Bolivia[^&]*(?:&(.*))?$
RewriteRule ^ "/US/"

3 Answers3

1

try this one:

RewriteCond %{REQUEST_URI} Bolivia
Redirect 301 / http://example.com/us/
Varun Malhotra
  • 1,202
  • 3
  • 15
  • 28
1

I find the solution:

RewriteCond %{REQUEST_URI} Bolivia 
RewriteRule ^ http://www.example.com/US/? [L,R=301]
0

Try this :

RewriteCond %{THE_REQUEST} /search\.php\?country=Bolivia&Select=([^&]+)&&?Location=([^\s&]+) [NC]
RewriteRule ^ /US/? [L,R]
Amit Verma
  • 40,709
  • 21
  • 93
  • 115
  • I'm not looking for this exact example but all URL that contain 'Bolivia' –  Mar 22 '16 at 14:04