I have a primary domain https://www.domain.com or https://domain.com and a wildcard DNS like https://domain.com/index.php?name=abcd redire
https://www.domain.com
https://domain.com
https://domain.com/index.php?name=abcd
try this :
RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}