Reputation: 1008
I want to redirect all requests to a single domain.
The target domain should have https and www.
Request examples:
http://aaa.de
http://www.aaa.de
https://aaa.de
https://www.aaa.de
http://bbb.de
http://www.bbb.de
https://bbb.de
https://www.bbb.de
http://mydomain.de
http://www.mydomain.de
All that request should be redirected to: https://www.mydomain.de
Upvotes: 0
Views: 167
Reputation: 785581
You can use this redirect rule in your site root .htaccess:
RewriteEngine On
RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} !^www\.mydomain\.de$ [NC]
RewriteRule ^ https://www.mydomain.de%{REQUEST_URI} [R=301,L,NE]
Make sure to use a new browser for your testing to avoid old browser cahhe.
Upvotes: 1