Options FollowSymLinks rewriteengine on RewriteCond %{REQUEST_FILENAME} !AJAXCoord.php(.*) RewriteRule ^search/([^/]*)/([^/]*)?/?$ /nursinghomes/showmap.php?state=$1&city=$2 ErrorDocument 404 http://127.0.0.1/nursinghomes/mainpage.php # My AJAX file looks like this one http://127.0.0.1/nursinghomes/AJAXCoord?state=NEW_YORK&city=Woodbury