I am trying to edit my .htaccess file to have the following rules:
if the URL contains a src=website.com AND has a parameters city=someCityHere AND state=StateHere go to this URL passing the city and state provided
OR
if URL contains src=website.com AND has zip=zipCodeHere go to this URL passing the zip code provided
OR if the url doesn't contain src=website.com redirect to thisWebsite.com
For example the url will look like this: www.mywebsite.com/?src=website.com&city=[city]&state=[state]
or www.mywebsite.com/?src=website.com&zip=[zip]
EDIT
Here are is the logic I have but it now gives a 500 error. Note the city and state value need to be separated by an underscore in the redirect url
RewriteCond %{THE_REQUEST} /\?src=website\.com&city=([^&]+)&state=([^&\s]+) [NC]
RewriteRule ^ www.anotherwebsite.com/$1_$2? [L,R=301]
RewriteCond %{THE_REQUEST} /\?src=website\.com&zip=([^&]+) [NC]
RewriteRule ^ www.anotherwebsite.com/$1? [L,R=301]
RewriteCond %{THE_REQUEST} !/\?src=website\.com [NC]
RewriteRule ^ http://www.anotherwebsite.com [L, R=301]