Thanks to the people of Stack Overflow I have the following in my htaccess to force www and https in URLs. It forks fine:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*) https://www.%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
Now - for my local enviroment - I want to exclude a URL of the form "local.name.de"
According to this post Apache mod_rewrite: force www only if not in localhost I added the following line:
RewriteEngine on
RewriteCond %{HTTP_HOST} !=local #new line
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*) https://www.%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
but it does not work. I also tried this without success:
RewriteCond %{HTTP_HOST} !=local.name.de
Could you help me on this? Thanks