I'd like to redirect any URL stat starts like [subdomain.]example.TLD[/?query_string]
to example.org[/?query_string]
Following rule sets each are working, but not in combination. I.e. www.example.com => example.org example.com/?query_string => example.org/?query_string
RewriteEngine On
RewriteCond %{HTTP_HOST} !=example.org
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^(.*)$ http://example.org/$1?%{QUERY_STRING} [R=301,L]
RewriteCond %{HTTP_HOST} !=example.org
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)$ http://example.org/$1 [R=301,L]