RewriteEngine on RewriteRule ^search/(.+)/(.*)/?$ /showmap.php?state=$1&city=$2 ErrorDocument 404 http://127.0.0.1/nursinghomes/mainpage.php