The following forces are non-www domains and send https requests to http and work fine for example.com. How can I use a wildcard for a domain?
RewriteCond %{HTTP_HOST} !^example\.com$
RewriteCond %{SERVER_PORT}s ^(443(s)|[0-9]+s)$
RewriteRule (.*) http%2://example.com/$1 [R=301,L]
I have two domains, example.com and example2.com. Both use the same code base and point to the same folder. If a visitor comes to the site through example2.com, the URL should remain example2.com and not go to example.com.
source
share