RewriteEngine on # Redirect to domain with www. RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} !^www. [NC] RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] # Same for HTTPS: RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} !^www. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] # Redirect to another domain: pulicentertecno.it. RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} !^(www.)?pulicentertecno.it$ [NC] RewriteRule .* http://pulicentertecno.it/disinfestazione-e-sanificazione-ambienti%{REQUEST_URI} [R=301,L] # Same for HTTPS: RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} !^(www.)?pulicentertecno.it$ [NC] RewriteRule .* https://pulicentertecno.it/disinfestazione-e-sanificazione-ambienti%{REQUEST_URI} [R=301,L]