I need to restrict a particular Query String pattern which has a URL as below
https://beta-portal.example.com/public/wp-login.php?redirect_to=http://demo.testfire.net
I need to restrict the redirect_to value to https://*.example.com if any other URL's are passed in redirect_to it should send a 403 forbidden error.
I tried something like below his but it is not working as expected. It always sends to 403 forbidden error.
RewriteCond %{QUERY_STRING} !.*redirect_to=*.example.com.* [NC]
RewriteRule "" "-" [F]
Can you please help me with the right syntax to implement the above negate rule.
Thanks in Advance.