# Only match the domain part.RewriteCond %{QUERY_STRING} ^(.*&)?location=(http://[^/&]+) [NC]# It will return FOUND if it is found.RewriteCond ${allowhost:%2|NOT-FOUND} !^FOUND$# If it wasn't found it will be sent to /error.html.RewriteRule ^/web/redirect$ /error.html [R=301,L]