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