I have two domains on my wordpress site: example.net
and example.com
and want to redirect all users to https://example.com
(with ssl and with out www).
Link examples:
http://example.com
http://www.example.com
http://example.net
http://www.example.net
https://example.com
https://www.example.com
https://example.net
https://www.example.net
Expression I use now:
RewriteEngine On
RewriteCond %{ENV:HTTPS} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
I tried to use some other standard expressions and they work somehow but this and all other solutions have the same problem. They don't redirect links to https://example.com/category/
or https://example.com/category/sub-category/
Another links as www.example.net/category/some.html
are redirected to example.com/category/some.html
as they should. Can't understand where is the problem.