I need to redirect something like this: http://www.abcd.com/abcd/$state-$county-$city.html To http://www.abcd.com/1234/$state-$city.html So basically just get rid of the '$county'. I've tried two things... RedirectMatch 301 ^/apartment/(.*)-(.*)-(.*).html http://www.abcd/forrent/$1-$3.html This redirected me to a url (example): state-city.html?state=WA&countyurl=King&cityurl=Seattle AND <? $state = $_GET['state']; $county = $_GET['county']; $city = $_GET['city']; header( "HTTP/1.1 301 Moved Permanently" ); header( "Location: http://www.rental-apt.com/$state-$city.html" ); exit(); ?> PHP: This just redirected me to a 404 page Can anyone please shed some light on this? Thanks!
I don't really understand what you're saying... the state, county, city are dynamic variables. It is not just one static page I'm trying to redirect. All trafffic directed to url format $state-$county-$city.html needs to be redirected to $state-$city.html